Skip to content

Commit

Permalink
Implement R16G16B16A16Snorm/R16G16B16A16Sint RT Formats
Browse files Browse the repository at this point in the history
Utilized in "The Touryst"
  • Loading branch information
PixelyIon committed Oct 27, 2021
1 parent df64ff5 commit a0921f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ namespace skyline::gpu::interconnect {
return format::R32B32G32A32Float;
case maxwell3d::RenderTarget::ColorFormat::R16G16B16A16Unorm:
return format::R16G16B16A16Unorm;
case maxwell3d::RenderTarget::ColorFormat::R16G16B16A16Snorm:
return format::R16G16B16A16Snorm;
case maxwell3d::RenderTarget::ColorFormat::R16G16B16A16Sint:
return format::R16G16B16A16Sint;
case maxwell3d::RenderTarget::ColorFormat::R16G16B16A16Uint:
return format::R16G16B16A16Uint;
case maxwell3d::RenderTarget::ColorFormat::R16G16B16A16Float:
Expand Down Expand Up @@ -206,6 +210,8 @@ namespace skyline::gpu::interconnect {
renderTarget.guest.mappings.assign(mappings.begin(), mappings.end());
}

renderTarget.guest.type = static_cast<texture::TextureType>(renderTarget.guest.dimensions.GetType());

renderTarget.view = gpu.texture.FindOrCreate(renderTarget.guest);
return &renderTarget.view.value();
}
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/cpp/skyline/gpu/texture/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ namespace skyline::gpu::format {
.green = swc::Blue,
}};
constexpr Format R16G16B16A16Unorm{sizeof(u16) * 4, vkf::eR16G16B16A16Unorm};
constexpr Format R16G16B16A16Snorm{sizeof(u16) * 4, vkf::eR16G16B16A16Snorm};
constexpr Format R16G16B16A16Sint{sizeof(u16) * 4, vkf::eR16G16B16A16Sint};
constexpr Format R16G16B16A16Uint{sizeof(u16) * 4, vkf::eR16G16B16A16Uint};
constexpr Format R16G16B16A16Float{sizeof(u16) * 4, vkf::eR16G16B16A16Sfloat};

Expand Down Expand Up @@ -77,6 +79,10 @@ namespace skyline::gpu::format {
return R8Uint;
case vk::Format::eR16G16B16A16Unorm:
return R16G16B16A16Unorm;
case vk::Format::eR16G16B16A16Snorm:
return R16G16B16A16Unorm;
case vk::Format::eR16G16B16A16Sint:
return R16G16B16A16Unorm;
case vk::Format::eR16G16B16A16Uint:
return R16G16B16A16Uint;
case vk::Format::eR16G16B16A16Sfloat:
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace skyline::soc::gm20b::engine::maxwell3d::type {
None = 0x0,
R32B32G32A32Float = 0xC0,
R16G16B16A16Unorm = 0xC6,
R16G16B16A16Snorm = 0xC7,
R16G16B16A16Sint = 0xC8,
R16G16B16A16Uint = 0xC9,
R16G16B16A16Float = 0xCA,
A2B10G10R10Unorm = 0xD1,
Expand Down

0 comments on commit a0921f8

Please sign in to comment.