summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-06-30 04:38:29 -0300
committerGravatar ReinUsesLisp2020-07-13 01:01:09 -0300
commit95c0f5afe580943fc58d8787aeb27623daacead5 (patch)
treebefe4d5bc15e2db36badc22d843b42eb8fd3df06 /src
parentvideo_core: Implement RGBA8_SINT render target (diff)
downloadyuzu-95c0f5afe580943fc58d8787aeb27623daacead5.tar.gz
yuzu-95c0f5afe580943fc58d8787aeb27623daacead5.tar.xz
yuzu-95c0f5afe580943fc58d8787aeb27623daacead5.zip
video_core: Implement RGBA16_SINT render target
Diffstat (limited to 'src')
-rw-r--r--src/video_core/gpu.h1
-rw-r--r--src/video_core/morton.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp1
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp1
-rw-r--r--src/video_core/renderer_vulkan/vk_device.cpp1
-rw-r--r--src/video_core/surface.cpp2
-rw-r--r--src/video_core/surface.h5
7 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index e3ab786e5..4a47862ce 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -43,6 +43,7 @@ enum class RenderTargetFormat : u32 {
43 RGBA32_UINT = 0xC2, 43 RGBA32_UINT = 0xC2,
44 RGBA16_UNORM = 0xC6, 44 RGBA16_UNORM = 0xC6,
45 RGBA16_SNORM = 0xC7, 45 RGBA16_SNORM = 0xC7,
46 RGBA16_SINT = 0xC8,
46 RGBA16_UINT = 0xC9, 47 RGBA16_UINT = 0xC9,
47 RGBA16_FLOAT = 0xCA, 48 RGBA16_FLOAT = 0xCA,
48 RG32_FLOAT = 0xCB, 49 RG32_FLOAT = 0xCB,
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index 452e1f01e..c7c8f2238 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -55,6 +55,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
55 MortonCopy<true, PixelFormat::RGBA16F>, 55 MortonCopy<true, PixelFormat::RGBA16F>,
56 MortonCopy<true, PixelFormat::RGBA16U>, 56 MortonCopy<true, PixelFormat::RGBA16U>,
57 MortonCopy<true, PixelFormat::RGBA16S>, 57 MortonCopy<true, PixelFormat::RGBA16S>,
58 MortonCopy<true, PixelFormat::RGBA16I>,
58 MortonCopy<true, PixelFormat::RGBA16UI>, 59 MortonCopy<true, PixelFormat::RGBA16UI>,
59 MortonCopy<true, PixelFormat::R11FG11FB10F>, 60 MortonCopy<true, PixelFormat::R11FG11FB10F>,
60 MortonCopy<true, PixelFormat::RGBA32UI>, 61 MortonCopy<true, PixelFormat::RGBA32UI>,
@@ -142,6 +143,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
142 MortonCopy<false, PixelFormat::R8UI>, 143 MortonCopy<false, PixelFormat::R8UI>,
143 MortonCopy<false, PixelFormat::RGBA16F>, 144 MortonCopy<false, PixelFormat::RGBA16F>,
144 MortonCopy<false, PixelFormat::RGBA16S>, 145 MortonCopy<false, PixelFormat::RGBA16S>,
146 MortonCopy<false, PixelFormat::RGBA16I>,
145 MortonCopy<false, PixelFormat::RGBA16U>, 147 MortonCopy<false, PixelFormat::RGBA16U>,
146 MortonCopy<false, PixelFormat::RGBA16UI>, 148 MortonCopy<false, PixelFormat::RGBA16UI>,
147 MortonCopy<false, PixelFormat::R11FG11FB10F>, 149 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.cpp
index 396b85e40..ff67ac813 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
55 {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT}, // RGBA16F 55 {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT}, // RGBA16F
56 {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // RGBA16U 56 {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT}, // RGBA16U
57 {GL_RGBA16_SNORM, GL_RGBA, GL_SHORT}, // RGBA16S 57 {GL_RGBA16_SNORM, GL_RGBA, GL_SHORT}, // RGBA16S
58 {GL_RGBA16I, GL_RGBA_INTEGER, GL_SHORT}, // RGBA16I
58 {GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT}, // RGBA16UI 59 {GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT}, // RGBA16UI
59 {GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV}, // R11FG11FB10F 60 {GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV}, // R11FG11FB10F
60 {GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT}, // RGBA32UI 61 {GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT}, // RGBA32UI
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index fe3b73a99..e79e0645d 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 {
131 {VK_FORMAT_R16G16B16A16_SFLOAT, Attachable | Storage}, // RGBA16F 131 {VK_FORMAT_R16G16B16A16_SFLOAT, Attachable | Storage}, // RGBA16F
132 {VK_FORMAT_R16G16B16A16_UNORM, Attachable | Storage}, // RGBA16U 132 {VK_FORMAT_R16G16B16A16_UNORM, Attachable | Storage}, // RGBA16U
133 {VK_FORMAT_R16G16B16A16_SNORM, Attachable | Storage}, // RGBA16S 133 {VK_FORMAT_R16G16B16A16_SNORM, Attachable | Storage}, // RGBA16S
134 {VK_FORMAT_R16G16B16A16_SINT, Attachable | Storage}, // RGBA16I
134 {VK_FORMAT_R16G16B16A16_UINT, Attachable | Storage}, // RGBA16UI 135 {VK_FORMAT_R16G16B16A16_UINT, Attachable | Storage}, // RGBA16UI
135 {VK_FORMAT_B10G11R11_UFLOAT_PACK32, Attachable | Storage}, // R11FG11FB10F 136 {VK_FORMAT_B10G11R11_UFLOAT_PACK32, Attachable | Storage}, // R11FG11FB10F
136 {VK_FORMAT_R32G32B32A32_UINT, Attachable | Storage}, // RGBA32UI 137 {VK_FORMAT_R32G32B32A32_UINT, Attachable | Storage}, // RGBA32UI
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp
index 7ae4005a8..a61a94c6c 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(
87 VK_FORMAT_R32G32_SFLOAT, 87 VK_FORMAT_R32G32_SFLOAT,
88 VK_FORMAT_R32G32_SINT, 88 VK_FORMAT_R32G32_SINT,
89 VK_FORMAT_R32G32_UINT, 89 VK_FORMAT_R32G32_UINT,
90 VK_FORMAT_R16G16B16A16_SINT,
90 VK_FORMAT_R16G16B16A16_UINT, 91 VK_FORMAT_R16G16B16A16_UINT,
91 VK_FORMAT_R16G16B16A16_SNORM, 92 VK_FORMAT_R16G16B16A16_SNORM,
92 VK_FORMAT_R16G16B16A16_UNORM, 93 VK_FORMAT_R16G16B16A16_UNORM,
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 0db995367..9c19e2838 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -100,6 +100,8 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
100 return PixelFormat::RGBA16U; 100 return PixelFormat::RGBA16U;
101 case Tegra::RenderTargetFormat::RGBA16_SNORM: 101 case Tegra::RenderTargetFormat::RGBA16_SNORM:
102 return PixelFormat::RGBA16S; 102 return PixelFormat::RGBA16S;
103 case Tegra::RenderTargetFormat::RGBA16_SINT:
104 return PixelFormat::RGBA16I;
103 case Tegra::RenderTargetFormat::RGBA16_UINT: 105 case Tegra::RenderTargetFormat::RGBA16_UINT:
104 return PixelFormat::RGBA16UI; 106 return PixelFormat::RGBA16UI;
105 case Tegra::RenderTargetFormat::RGBA16_FLOAT: 107 case Tegra::RenderTargetFormat::RGBA16_FLOAT:
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 6f3162986..27d447cb9 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -29,6 +29,7 @@ enum class PixelFormat {
29 RGBA16F, 29 RGBA16F,
30 RGBA16U, 30 RGBA16U,
31 RGBA16S, 31 RGBA16S,
32 RGBA16I,
32 RGBA16UI, 33 RGBA16UI,
33 R11FG11FB10F, 34 R11FG11FB10F,
34 RGBA32UI, 35 RGBA32UI,
@@ -149,6 +150,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
149 0, // RGBA16F 150 0, // RGBA16F
150 0, // RGBA16U 151 0, // RGBA16U
151 0, // RGBA16S 152 0, // RGBA16S
153 0, // RGBA16I
152 0, // RGBA16UI 154 0, // RGBA16UI
153 0, // R11FG11FB10F 155 0, // R11FG11FB10F
154 0, // RGBA32UI 156 0, // RGBA32UI
@@ -253,6 +255,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
253 1, // RGBA16F 255 1, // RGBA16F
254 1, // RGBA16U 256 1, // RGBA16U
255 1, // RGBA16S 257 1, // RGBA16S
258 1, // RGBA16I
256 1, // RGBA16UI 259 1, // RGBA16UI
257 1, // R11FG11FB10F 260 1, // R11FG11FB10F
258 1, // RGBA32UI 261 1, // RGBA32UI
@@ -349,6 +352,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
349 1, // RGBA16F 352 1, // RGBA16F
350 1, // RGBA16U 353 1, // RGBA16U
351 1, // RGBA16S 354 1, // RGBA16S
355 1, // RGBA16I
352 1, // RGBA16UI 356 1, // RGBA16UI
353 1, // R11FG11FB10F 357 1, // R11FG11FB10F
354 1, // RGBA32UI 358 1, // RGBA32UI
@@ -445,6 +449,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
445 64, // RGBA16F 449 64, // RGBA16F
446 64, // RGBA16U 450 64, // RGBA16U
447 64, // RGBA16S 451 64, // RGBA16S
452 64, // RGBA16I
448 64, // RGBA16UI 453 64, // RGBA16UI
449 32, // R11FG11FB10F 454 32, // R11FG11FB10F
450 128, // RGBA32UI 455 128, // RGBA32UI