VERY experimental Nintendo Switch 2 emulator
C++
video_core: Implement RG32_SINT render target
ReinUsesLispad494d0a3c99
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.hindex a6f846f3c4..b0a2ad21b2 100644--- a/src/video_core/gpu.h+++ b/src/video_core/gpu.h@@ -46,6 +46,7 @@ enum class RenderTargetFormat : u32 {RGBA16_UINT = 0xC9,RGBA16_FLOAT = 0xCA,RG32_FLOAT = 0xCB,+ RG32_SINT = 0xCC,RG32_UINT = 0xCD,RGBX16_FLOAT = 0xCE,BGRA8_UNORM = 0xCF,diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cppindex 9e50aa11de..f932df53f2 100644--- a/src/video_core/morton.cpp+++ b/src/video_core/morton.cpp@@ -70,6 +70,7 @@ static constexpr ConversionArray morton_to_linear_fns = {MortonCopy<true, PixelFormat::BGRA8>,MortonCopy<true, PixelFormat::RGBA32F>,MortonCopy<true, PixelFormat::RG32F>,+ MortonCopy<true, PixelFormat::RG32I>,MortonCopy<true, PixelFormat::R32F>,MortonCopy<true, PixelFormat::R16F>,MortonCopy<true, PixelFormat::R16U>,@@ -157,6 +158,7 @@ static constexpr ConversionArray linear_to_morton_fns = {MortonCopy<false, PixelFormat::BGRA8>,MortonCopy<false, PixelFormat::RGBA32F>,MortonCopy<false, PixelFormat::RG32F>,+ MortonCopy<false, PixelFormat::RG32I>,MortonCopy<false, PixelFormat::R32F>,MortonCopy<false, PixelFormat::R16F>,MortonCopy<false, PixelFormat::R16U>,diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cppindex ef17298940..1d7824324f 100644--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp@@ -70,6 +70,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format{GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE}, // BGRA8{GL_RGBA32F, GL_RGBA, GL_FLOAT}, // RGBA32F{GL_RG32F, GL_RG, GL_FLOAT}, // RG32F+ {GL_RG32I, GL_RG_INTEGER, GL_INT}, // RG32I{GL_R32F, GL_RED, GL_FLOAT}, // R32F{GL_R16F, GL_RED, GL_HALF_FLOAT}, // R16F{GL_R16, GL_RED, GL_UNSIGNED_SHORT}, // R16Udiff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cppindex 43264ce145..4086d1bb69 100644--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp@@ -146,6 +146,7 @@ struct FormatTuple {{VK_FORMAT_B8G8R8A8_UNORM, Attachable}, // BGRA8{VK_FORMAT_R32G32B32A32_SFLOAT, Attachable | Storage}, // RGBA32F{VK_FORMAT_R32G32_SFLOAT, Attachable | Storage}, // RG32F+ {VK_FORMAT_R32G32_SINT, Attachable | Storage}, // RG32I{VK_FORMAT_R32_SFLOAT, Attachable | Storage}, // R32F{VK_FORMAT_R16_SFLOAT, Attachable | Storage}, // R16F{VK_FORMAT_R16_UNORM, Attachable | Storage}, // R16Udiff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cppindex 06c6169dc2..e1128efe65 100644--- a/src/video_core/renderer_vulkan/vk_device.cpp+++ b/src/video_core/renderer_vulkan/vk_device.cpp@@ -84,6 +84,7 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(VK_FORMAT_R32G32B32A32_SFLOAT,VK_FORMAT_R32G32B32A32_UINT,VK_FORMAT_R32G32_SFLOAT,+ VK_FORMAT_R32G32_SINT,VK_FORMAT_R32G32_UINT,VK_FORMAT_R16G16B16A16_UINT,VK_FORMAT_R16G16B16A16_SNORM,diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cppindex 1f12163fed..13e598972c 100644--- a/src/video_core/surface.cpp+++ b/src/video_core/surface.cpp@@ -106,6 +106,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)return PixelFormat::RGBA16F;case Tegra::RenderTargetFormat::RG32_FLOAT:return PixelFormat::RG32F;+ case Tegra::RenderTargetFormat::RG32_SINT:+ return PixelFormat::RG32I;case Tegra::RenderTargetFormat::RG32_UINT:return PixelFormat::RG32UI;case Tegra::RenderTargetFormat::RGBX16_FLOAT:diff --git a/src/video_core/surface.h b/src/video_core/surface.hindex 6999d9dc36..3e9dd797a1 100644--- a/src/video_core/surface.h+++ b/src/video_core/surface.h@@ -44,6 +44,7 @@ enum class PixelFormat {BGRA8,RGBA32F,RG32F,+ RG32I,R32F,R16F,R16U,@@ -162,6 +163,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{0, // BGRA80, // RGBA32F0, // RG32F+ 0, // RG32I0, // R32F0, // R16F0, // R16U@@ -264,6 +266,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{1, // BGRA81, // RGBA32F1, // RG32F+ 1, // RG32I1, // R32F1, // R16F1, // R16U@@ -358,6 +361,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{1, // BGRA81, // RGBA32F1, // RG32F+ 1, // RG32I1, // R32F1, // R16F1, // R16U@@ -452,6 +456,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{32, // BGRA8128, // RGBA32F64, // RG32F+ 64, // RG32I32, // R32F16, // R16F16, // R16U