VERY experimental Nintendo Switch 2 emulator
C++
video_core: Implement RGBA16_SINT render target
ReinUsesLisp5ba68f5fabd1
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.hindex e3ab786e59..4a47862cec 100644--- a/src/video_core/gpu.h+++ b/src/video_core/gpu.h@@ -43,6 +43,7 @@ enum class RenderTargetFormat : u32 {RGBA32_UINT = 0xC2,RGBA16_UNORM = 0xC6,RGBA16_SNORM = 0xC7,+ RGBA16_SINT = 0xC8,RGBA16_UINT = 0xC9,RGBA16_FLOAT = 0xCA,RG32_FLOAT = 0xCB,diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cppindex 452e1f01e7..c7c8f2238f 100644--- a/src/video_core/morton.cpp+++ b/src/video_core/morton.cpp@@ -55,6 +55,7 @@ static constexpr ConversionArray morton_to_linear_fns = {MortonCopy<true, PixelFormat::RGBA16F>,MortonCopy<true, PixelFormat::RGBA16U>,MortonCopy<true, PixelFormat::RGBA16S>,+ MortonCopy<true, PixelFormat::RGBA16I>,MortonCopy<true, PixelFormat::RGBA16UI>,MortonCopy<true, PixelFormat::R11FG11FB10F>,MortonCopy<true, PixelFormat::RGBA32UI>,@@ -142,6 +143,7 @@ static constexpr ConversionArray linear_to_morton_fns = {MortonCopy<false, PixelFormat::R8UI>,MortonCopy<false, PixelFormat::RGBA16F>,MortonCopy<false, PixelFormat::RGBA16S>,+ MortonCopy<false, PixelFormat::RGBA16I>,MortonCopy<false, PixelFormat::RGBA16U>,MortonCopy<false, PixelFormat::RGBA16UI>,MortonCopy<false, PixelFormat::R11FG11FB10F>,diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cppindex 396b85e406..ff67ac8137 100644--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp@@ -55,6 +55,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format{GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT}, // RGBA16F{GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // RGBA16U{GL_RGBA16_SNORM, GL_RGBA, GL_SHORT}, // RGBA16S+ {GL_RGBA16I, GL_RGBA_INTEGER, GL_SHORT}, // RGBA16I{GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT}, // RGBA16UI{GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV}, // R11FG11FB10F{GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT}, // RGBA32UIdiff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cppindex fe3b73a994..e79e0645d7 100644--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp@@ -131,6 +131,7 @@ struct FormatTuple {{VK_FORMAT_R16G16B16A16_SFLOAT, Attachable | Storage}, // RGBA16F{VK_FORMAT_R16G16B16A16_UNORM, Attachable | Storage}, // RGBA16U{VK_FORMAT_R16G16B16A16_SNORM, Attachable | Storage}, // RGBA16S+ {VK_FORMAT_R16G16B16A16_SINT, Attachable | Storage}, // RGBA16I{VK_FORMAT_R16G16B16A16_UINT, Attachable | Storage}, // RGBA16UI{VK_FORMAT_B10G11R11_UFLOAT_PACK32, Attachable | Storage}, // R11FG11FB10F{VK_FORMAT_R32G32B32A32_UINT, Attachable | Storage}, // RGBA32UIdiff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cppindex 7ae4005a89..a61a94c6c5 100644--- a/src/video_core/renderer_vulkan/vk_device.cpp+++ b/src/video_core/renderer_vulkan/vk_device.cpp@@ -87,6 +87,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(VK_FORMAT_R32G32_SFLOAT,VK_FORMAT_R32G32_SINT,VK_FORMAT_R32G32_UINT,+ VK_FORMAT_R16G16B16A16_SINT,VK_FORMAT_R16G16B16A16_UINT,VK_FORMAT_R16G16B16A16_SNORM,VK_FORMAT_R16G16B16A16_UNORM,diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cppindex 0db995367a..9c19e28389 100644--- a/src/video_core/surface.cpp+++ b/src/video_core/surface.cpp@@ -100,6 +100,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)return PixelFormat::RGBA16U;case Tegra::RenderTargetFormat::RGBA16_SNORM:return PixelFormat::RGBA16S;+ case Tegra::RenderTargetFormat::RGBA16_SINT:+ return PixelFormat::RGBA16I;case Tegra::RenderTargetFormat::RGBA16_UINT:return PixelFormat::RGBA16UI;case Tegra::RenderTargetFormat::RGBA16_FLOAT:diff --git a/src/video_core/surface.h b/src/video_core/surface.hindex 6f3162986c..27d447cb94 100644--- a/src/video_core/surface.h+++ b/src/video_core/surface.h@@ -29,6 +29,7 @@ enum class PixelFormat {RGBA16F,RGBA16U,RGBA16S,+ RGBA16I,RGBA16UI,R11FG11FB10F,RGBA32UI,@@ -149,6 +150,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{0, // RGBA16F0, // RGBA16U0, // RGBA16S+ 0, // RGBA16I0, // RGBA16UI0, // R11FG11FB10F0, // RGBA32UI@@ -253,6 +255,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{1, // RGBA16F1, // RGBA16U1, // RGBA16S+ 1, // RGBA16I1, // RGBA16UI1, // R11FG11FB10F1, // RGBA32UI@@ -349,6 +352,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{1, // RGBA16F1, // RGBA16U1, // RGBA16S+ 1, // RGBA16I1, // RGBA16UI1, // R11FG11FB10F1, // RGBA32UI@@ -445,6 +449,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{64, // RGBA16F64, // RGBA16U64, // RGBA16S+ 64, // RGBA16I64, // RGBA16UI32, // R11FG11FB10F128, // RGBA32UI