summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2020-02-25 14:08:45 -0500
committerGravatar GitHub2020-02-25 14:08:45 -0500
commit78ab2e0474fabff54ee1bcbd9242f90aa20ddc06 (patch)
tree875365331ea4977a3ad785b4b1bb092fce99c3f5 /src
parentMerge pull request #3425 from ReinUsesLisp/layered-framebuffer (diff)
parenttexture: Implement R32I (diff)
downloadyuzu-78ab2e0474fabff54ee1bcbd9242f90aa20ddc06.tar.gz
yuzu-78ab2e0474fabff54ee1bcbd9242f90aa20ddc06.tar.xz
yuzu-78ab2e0474fabff54ee1bcbd9242f90aa20ddc06.zip
Merge pull request #3417 from ReinUsesLisp/r32i
texture: Implement R32I
Diffstat (limited to 'src')
-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.h72
-rw-r--r--src/video_core/texture_cache/format_lookup_table.cpp3
6 files changed, 46 insertions, 34 deletions
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index 2f2fe6859..f2c83266e 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -85,6 +85,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
85 MortonCopy<true, PixelFormat::RG32UI>, 85 MortonCopy<true, PixelFormat::RG32UI>,
86 MortonCopy<true, PixelFormat::RGBX16F>, 86 MortonCopy<true, PixelFormat::RGBX16F>,
87 MortonCopy<true, PixelFormat::R32UI>, 87 MortonCopy<true, PixelFormat::R32UI>,
88 MortonCopy<true, PixelFormat::R32I>,
88 MortonCopy<true, PixelFormat::ASTC_2D_8X8>, 89 MortonCopy<true, PixelFormat::ASTC_2D_8X8>,
89 MortonCopy<true, PixelFormat::ASTC_2D_8X5>, 90 MortonCopy<true, PixelFormat::ASTC_2D_8X5>,
90 MortonCopy<true, PixelFormat::ASTC_2D_5X4>, 91 MortonCopy<true, PixelFormat::ASTC_2D_5X4>,
@@ -166,6 +167,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
166 MortonCopy<false, PixelFormat::RG32UI>, 167 MortonCopy<false, PixelFormat::RG32UI>,
167 MortonCopy<false, PixelFormat::RGBX16F>, 168 MortonCopy<false, PixelFormat::RGBX16F>,
168 MortonCopy<false, PixelFormat::R32UI>, 169 MortonCopy<false, PixelFormat::R32UI>,
170 MortonCopy<false, PixelFormat::R32I>,
169 nullptr, 171 nullptr,
170 nullptr, 172 nullptr,
171 nullptr, 173 nullptr,
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index c4c0bd226..cf934b0d8 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -87,6 +87,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
87 {GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT, false}, // RG32UI 87 {GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT, false}, // RG32UI
88 {GL_RGB16F, GL_RGBA, GL_HALF_FLOAT, false}, // RGBX16F 88 {GL_RGB16F, GL_RGBA, GL_HALF_FLOAT, false}, // RGBX16F
89 {GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT, false}, // R32UI 89 {GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT, false}, // R32UI
90 {GL_R32I, GL_RED_INTEGER, GL_INT, false}, // R32I
90 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, false}, // ASTC_2D_8X8 91 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, false}, // ASTC_2D_8X8
91 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, false}, // ASTC_2D_8X5 92 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, false}, // ASTC_2D_8X5
92 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, false}, // ASTC_2D_5X4 93 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, false}, // ASTC_2D_5X4
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 5403c3ab7..ef66dd141 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -159,6 +159,7 @@ struct FormatTuple {
159 {vk::Format::eR32G32Uint, Attachable | Storage}, // RG32UI 159 {vk::Format::eR32G32Uint, Attachable | Storage}, // RG32UI
160 {vk::Format::eUndefined, {}}, // RGBX16F 160 {vk::Format::eUndefined, {}}, // RGBX16F
161 {vk::Format::eR32Uint, Attachable | Storage}, // R32UI 161 {vk::Format::eR32Uint, Attachable | Storage}, // R32UI
162 {vk::Format::eR32Sint, Attachable | Storage}, // R32I
162 {vk::Format::eAstc8x8UnormBlock, {}}, // ASTC_2D_8X8 163 {vk::Format::eAstc8x8UnormBlock, {}}, // ASTC_2D_8X8
163 {vk::Format::eUndefined, {}}, // ASTC_2D_8X5 164 {vk::Format::eUndefined, {}}, // ASTC_2D_8X5
164 {vk::Format::eUndefined, {}}, // ASTC_2D_5X4 165 {vk::Format::eUndefined, {}}, // ASTC_2D_5X4
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp
index d1da4f9d3..886bde3b9 100644
--- a/src/video_core/renderer_vulkan/vk_device.cpp
+++ b/src/video_core/renderer_vulkan/vk_device.cpp
@@ -523,6 +523,7 @@ std::unordered_map<vk::Format, vk::FormatProperties> VKDevice::GetFormatProperti
523 vk::Format::eB10G11R11UfloatPack32, 523 vk::Format::eB10G11R11UfloatPack32,
524 vk::Format::eR32Sfloat, 524 vk::Format::eR32Sfloat,
525 vk::Format::eR32Uint, 525 vk::Format::eR32Uint,
526 vk::Format::eR32Sint,
526 vk::Format::eR16Sfloat, 527 vk::Format::eR16Sfloat,
527 vk::Format::eR16G16B16A16Sfloat, 528 vk::Format::eR16G16B16A16Sfloat,
528 vk::Format::eB8G8R8A8Unorm, 529 vk::Format::eB8G8R8A8Unorm,
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 0d17a93ed..d88109e5a 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -59,47 +59,48 @@ enum class PixelFormat {
59 RG32UI = 41, 59 RG32UI = 41,
60 RGBX16F = 42, 60 RGBX16F = 42,
61 R32UI = 43, 61 R32UI = 43,
62 ASTC_2D_8X8 = 44, 62 R32I = 44,
63 ASTC_2D_8X5 = 45, 63 ASTC_2D_8X8 = 45,
64 ASTC_2D_5X4 = 46, 64 ASTC_2D_8X5 = 46,
65 BGRA8_SRGB = 47, 65 ASTC_2D_5X4 = 47,
66 DXT1_SRGB = 48, 66 BGRA8_SRGB = 48,
67 DXT23_SRGB = 49, 67 DXT1_SRGB = 49,
68 DXT45_SRGB = 50, 68 DXT23_SRGB = 50,
69 BC7U_SRGB = 51, 69 DXT45_SRGB = 51,
70 R4G4B4A4U = 52, 70 BC7U_SRGB = 52,
71 ASTC_2D_4X4_SRGB = 53, 71 R4G4B4A4U = 53,
72 ASTC_2D_8X8_SRGB = 54, 72 ASTC_2D_4X4_SRGB = 54,
73 ASTC_2D_8X5_SRGB = 55, 73 ASTC_2D_8X8_SRGB = 55,
74 ASTC_2D_5X4_SRGB = 56, 74 ASTC_2D_8X5_SRGB = 56,
75 ASTC_2D_5X5 = 57, 75 ASTC_2D_5X4_SRGB = 57,
76 ASTC_2D_5X5_SRGB = 58, 76 ASTC_2D_5X5 = 58,
77 ASTC_2D_10X8 = 59, 77 ASTC_2D_5X5_SRGB = 59,
78 ASTC_2D_10X8_SRGB = 60, 78 ASTC_2D_10X8 = 60,
79 ASTC_2D_6X6 = 61, 79 ASTC_2D_10X8_SRGB = 61,
80 ASTC_2D_6X6_SRGB = 62, 80 ASTC_2D_6X6 = 62,
81 ASTC_2D_10X10 = 63, 81 ASTC_2D_6X6_SRGB = 63,
82 ASTC_2D_10X10_SRGB = 64, 82 ASTC_2D_10X10 = 64,
83 ASTC_2D_12X12 = 65, 83 ASTC_2D_10X10_SRGB = 65,
84 ASTC_2D_12X12_SRGB = 66, 84 ASTC_2D_12X12 = 66,
85 ASTC_2D_8X6 = 67, 85 ASTC_2D_12X12_SRGB = 67,
86 ASTC_2D_8X6_SRGB = 68, 86 ASTC_2D_8X6 = 68,
87 ASTC_2D_6X5 = 69, 87 ASTC_2D_8X6_SRGB = 69,
88 ASTC_2D_6X5_SRGB = 70, 88 ASTC_2D_6X5 = 70,
89 E5B9G9R9F = 71, 89 ASTC_2D_6X5_SRGB = 71,
90 E5B9G9R9F = 72,
90 91
91 MaxColorFormat, 92 MaxColorFormat,
92 93
93 // Depth formats 94 // Depth formats
94 Z32F = 72, 95 Z32F = 73,
95 Z16 = 73, 96 Z16 = 74,
96 97
97 MaxDepthFormat, 98 MaxDepthFormat,
98 99
99 // DepthStencil formats 100 // DepthStencil formats
100 Z24S8 = 74, 101 Z24S8 = 75,
101 S8Z24 = 75, 102 S8Z24 = 76,
102 Z32FS8 = 76, 103 Z32FS8 = 77,
103 104
104 MaxDepthStencilFormat, 105 MaxDepthStencilFormat,
105 106
@@ -171,6 +172,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
171 0, // RG32UI 172 0, // RG32UI
172 0, // RGBX16F 173 0, // RGBX16F
173 0, // R32UI 174 0, // R32UI
175 0, // R32I
174 2, // ASTC_2D_8X8 176 2, // ASTC_2D_8X8
175 2, // ASTC_2D_8X5 177 2, // ASTC_2D_8X5
176 2, // ASTC_2D_5X4 178 2, // ASTC_2D_5X4
@@ -267,6 +269,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
267 1, // RG32UI 269 1, // RG32UI
268 1, // RGBX16F 270 1, // RGBX16F
269 1, // R32UI 271 1, // R32UI
272 1, // R32I
270 8, // ASTC_2D_8X8 273 8, // ASTC_2D_8X8
271 8, // ASTC_2D_8X5 274 8, // ASTC_2D_8X5
272 5, // ASTC_2D_5X4 275 5, // ASTC_2D_5X4
@@ -355,6 +358,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
355 1, // RG32UI 358 1, // RG32UI
356 1, // RGBX16F 359 1, // RGBX16F
357 1, // R32UI 360 1, // R32UI
361 1, // R32I
358 8, // ASTC_2D_8X8 362 8, // ASTC_2D_8X8
359 5, // ASTC_2D_8X5 363 5, // ASTC_2D_8X5
360 4, // ASTC_2D_5X4 364 4, // ASTC_2D_5X4
@@ -443,6 +447,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
443 64, // RG32UI 447 64, // RG32UI
444 64, // RGBX16F 448 64, // RGBX16F
445 32, // R32UI 449 32, // R32UI
450 32, // R32I
446 128, // ASTC_2D_8X8 451 128, // ASTC_2D_8X8
447 128, // ASTC_2D_8X5 452 128, // ASTC_2D_8X5
448 128, // ASTC_2D_5X4 453 128, // ASTC_2D_5X4
@@ -546,6 +551,7 @@ constexpr std::array<SurfaceCompression, MaxPixelFormat> compression_type_table
546 SurfaceCompression::None, // RG32UI 551 SurfaceCompression::None, // RG32UI
547 SurfaceCompression::None, // RGBX16F 552 SurfaceCompression::None, // RGBX16F
548 SurfaceCompression::None, // R32UI 553 SurfaceCompression::None, // R32UI
554 SurfaceCompression::None, // R32I
549 SurfaceCompression::Converted, // ASTC_2D_8X8 555 SurfaceCompression::Converted, // ASTC_2D_8X8
550 SurfaceCompression::Converted, // ASTC_2D_8X5 556 SurfaceCompression::Converted, // ASTC_2D_8X5
551 SurfaceCompression::Converted, // ASTC_2D_5X4 557 SurfaceCompression::Converted, // ASTC_2D_5X4
diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp
index 81fb9f633..cc3ad8417 100644
--- a/src/video_core/texture_cache/format_lookup_table.cpp
+++ b/src/video_core/texture_cache/format_lookup_table.cpp
@@ -41,7 +41,7 @@ struct Table {
41 ComponentType alpha_component; 41 ComponentType alpha_component;
42 bool is_srgb; 42 bool is_srgb;
43}; 43};
44constexpr std::array<Table, 74> DefinitionTable = {{ 44constexpr std::array<Table, 75> DefinitionTable = {{
45 {TextureFormat::A8R8G8B8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::ABGR8U}, 45 {TextureFormat::A8R8G8B8, C, UNORM, UNORM, UNORM, UNORM, PixelFormat::ABGR8U},
46 {TextureFormat::A8R8G8B8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::ABGR8S}, 46 {TextureFormat::A8R8G8B8, C, SNORM, SNORM, SNORM, SNORM, PixelFormat::ABGR8S},
47 {TextureFormat::A8R8G8B8, C, UINT, UINT, UINT, UINT, PixelFormat::ABGR8UI}, 47 {TextureFormat::A8R8G8B8, C, UINT, UINT, UINT, UINT, PixelFormat::ABGR8UI},
@@ -89,6 +89,7 @@ constexpr std::array<Table, 74> DefinitionTable = {{
89 89
90 {TextureFormat::R32, C, FLOAT, FLOAT, FLOAT, FLOAT, PixelFormat::R32F}, 90 {TextureFormat::R32, C, FLOAT, FLOAT, FLOAT, FLOAT, PixelFormat::R32F},
91 {TextureFormat::R32, C, UINT, UINT, UINT, UINT, PixelFormat::R32UI}, 91 {TextureFormat::R32, C, UINT, UINT, UINT, UINT, PixelFormat::R32UI},
92 {TextureFormat::R32, C, SINT, SINT, SINT, SINT, PixelFormat::R32I},
92 93
93 {TextureFormat::E5B9G9R9_SHAREDEXP, C, FLOAT, FLOAT, FLOAT, FLOAT, PixelFormat::E5B9G9R9F}, 94 {TextureFormat::E5B9G9R9_SHAREDEXP, C, FLOAT, FLOAT, FLOAT, FLOAT, PixelFormat::E5B9G9R9F},
94 95