summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp16
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h66
-rw-r--r--src/video_core/textures/decoders.cpp4
3 files changed, 55 insertions, 31 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index d87f90a62..e53a1a2ec 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -120,7 +120,11 @@ static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_form
120 true}, // DXN2UNORM 120 true}, // DXN2UNORM
121 {GL_COMPRESSED_SIGNED_RG_RGTC2, GL_RG, GL_INT, ComponentType::SNorm, true}, // DXN2SNORM 121 {GL_COMPRESSED_SIGNED_RG_RGTC2, GL_RG, GL_INT, ComponentType::SNorm, true}, // DXN2SNORM
122 {GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm, 122 {GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm,
123 true}, // BC7U 123 true}, // BC7U
124 {GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB, GL_RGB, GL_UNSIGNED_INT_8_8_8_8,
125 ComponentType::UNorm, true}, // BC6H_UF16
126 {GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_RGB, GL_UNSIGNED_INT_8_8_8_8, ComponentType::UNorm,
127 true}, // BC6H_SF16
124 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_4X4 128 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_4X4
125 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // G8R8U 129 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // G8R8U
126 {GL_RG8, GL_RG, GL_BYTE, ComponentType::SNorm, false}, // G8R8S 130 {GL_RG8, GL_RG, GL_BYTE, ComponentType::SNorm, false}, // G8R8S
@@ -210,6 +214,8 @@ static bool IsFormatBCn(PixelFormat format) {
210 case PixelFormat::DXN2SNORM: 214 case PixelFormat::DXN2SNORM:
211 case PixelFormat::DXN2UNORM: 215 case PixelFormat::DXN2UNORM:
212 case PixelFormat::BC7U: 216 case PixelFormat::BC7U:
217 case PixelFormat::BC6H_UF16:
218 case PixelFormat::BC6H_SF16:
213 return true; 219 return true;
214 } 220 }
215 return false; 221 return false;
@@ -266,6 +272,8 @@ static constexpr std::array<void (*)(u32, u32, u32, std::vector<u8>&, Tegra::GPU
266 MortonCopy<true, PixelFormat::DXN2UNORM>, 272 MortonCopy<true, PixelFormat::DXN2UNORM>,
267 MortonCopy<true, PixelFormat::DXN2SNORM>, 273 MortonCopy<true, PixelFormat::DXN2SNORM>,
268 MortonCopy<true, PixelFormat::BC7U>, 274 MortonCopy<true, PixelFormat::BC7U>,
275 MortonCopy<true, PixelFormat::BC6H_UF16>,
276 MortonCopy<true, PixelFormat::BC6H_SF16>,
269 MortonCopy<true, PixelFormat::ASTC_2D_4X4>, 277 MortonCopy<true, PixelFormat::ASTC_2D_4X4>,
270 MortonCopy<true, PixelFormat::G8R8U>, 278 MortonCopy<true, PixelFormat::G8R8U>,
271 MortonCopy<true, PixelFormat::G8R8S>, 279 MortonCopy<true, PixelFormat::G8R8S>,
@@ -314,8 +322,10 @@ static constexpr std::array<void (*)(u32, u32, u32, std::vector<u8>&, Tegra::GPU
314 MortonCopy<false, PixelFormat::RGBA16UI>, 322 MortonCopy<false, PixelFormat::RGBA16UI>,
315 MortonCopy<false, PixelFormat::R11FG11FB10F>, 323 MortonCopy<false, PixelFormat::R11FG11FB10F>,
316 MortonCopy<false, PixelFormat::RGBA32UI>, 324 MortonCopy<false, PixelFormat::RGBA32UI>,
317 // TODO(Subv): Swizzling DXT1/DXT23/DXT45/DXN1/DXN2/BC7U/ASTC_2D_4X4 formats is not 325 // TODO(Subv): Swizzling DXT1/DXT23/DXT45/DXN1/DXN2/BC7U/BC6H_UF16/BC6H_SF16/ASTC_2D_4X4
318 // supported 326 // formats are not supported
327 nullptr,
328 nullptr,
319 nullptr, 329 nullptr,
320 nullptr, 330 nullptr,
321 nullptr, 331 nullptr,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index 8a6ca2a4b..ecdd8d8e5 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -45,42 +45,44 @@ struct SurfaceParams {
45 DXN2UNORM = 17, 45 DXN2UNORM = 17,
46 DXN2SNORM = 18, 46 DXN2SNORM = 18,
47 BC7U = 19, 47 BC7U = 19,
48 ASTC_2D_4X4 = 20, 48 BC6H_UF16 = 20,
49 G8R8U = 21, 49 BC6H_SF16 = 21,
50 G8R8S = 22, 50 ASTC_2D_4X4 = 22,
51 BGRA8 = 23, 51 G8R8U = 23,
52 RGBA32F = 24, 52 G8R8S = 24,
53 RG32F = 25, 53 BGRA8 = 25,
54 R32F = 26, 54 RGBA32F = 26,
55 R16F = 27, 55 RG32F = 27,
56 R16U = 28, 56 R32F = 28,
57 R16S = 29, 57 R16F = 29,
58 R16UI = 30, 58 R16U = 30,
59 R16I = 31, 59 R16S = 31,
60 RG16 = 32, 60 R16UI = 32,
61 RG16F = 33, 61 R16I = 33,
62 RG16UI = 34, 62 RG16 = 34,
63 RG16I = 35, 63 RG16F = 35,
64 RG16S = 36, 64 RG16UI = 36,
65 RGB32F = 37, 65 RG16I = 37,
66 SRGBA8 = 38, 66 RG16S = 38,
67 RG8U = 39, 67 RGB32F = 39,
68 RG8S = 40, 68 SRGBA8 = 40,
69 RG32UI = 41, 69 RG8U = 41,
70 R32UI = 42, 70 RG8S = 42,
71 RG32UI = 43,
72 R32UI = 44,
71 73
72 MaxColorFormat, 74 MaxColorFormat,
73 75
74 // Depth formats 76 // Depth formats
75 Z32F = 43, 77 Z32F = 45,
76 Z16 = 44, 78 Z16 = 46,
77 79
78 MaxDepthFormat, 80 MaxDepthFormat,
79 81
80 // DepthStencil formats 82 // DepthStencil formats
81 Z24S8 = 45, 83 Z24S8 = 47,
82 S8Z24 = 46, 84 S8Z24 = 48,
83 Z32FS8 = 47, 85 Z32FS8 = 49,
84 86
85 MaxDepthStencilFormat, 87 MaxDepthStencilFormat,
86 88
@@ -138,6 +140,8 @@ struct SurfaceParams {
138 4, // DXN2UNORM 140 4, // DXN2UNORM
139 4, // DXN2SNORM 141 4, // DXN2SNORM
140 4, // BC7U 142 4, // BC7U
143 4, // BC6H_UF16
144 4, // BC6H_SF16
141 4, // ASTC_2D_4X4 145 4, // ASTC_2D_4X4
142 1, // G8R8U 146 1, // G8R8U
143 1, // G8R8S 147 1, // G8R8S
@@ -197,6 +201,8 @@ struct SurfaceParams {
197 128, // DXN2UNORM 201 128, // DXN2UNORM
198 128, // DXN2SNORM 202 128, // DXN2SNORM
199 128, // BC7U 203 128, // BC7U
204 128, // BC6H_UF16
205 128, // BC6H_SF16
200 32, // ASTC_2D_4X4 206 32, // ASTC_2D_4X4
201 16, // G8R8U 207 16, // G8R8U
202 16, // G8R8S 208 16, // G8R8S
@@ -482,6 +488,10 @@ struct SurfaceParams {
482 UNREACHABLE(); 488 UNREACHABLE();
483 case Tegra::Texture::TextureFormat::BC7U: 489 case Tegra::Texture::TextureFormat::BC7U:
484 return PixelFormat::BC7U; 490 return PixelFormat::BC7U;
491 case Tegra::Texture::TextureFormat::BC6H_UF16:
492 return PixelFormat::BC6H_UF16;
493 case Tegra::Texture::TextureFormat::BC6H_SF16:
494 return PixelFormat::BC6H_SF16;
485 case Tegra::Texture::TextureFormat::ASTC_2D_4X4: 495 case Tegra::Texture::TextureFormat::ASTC_2D_4X4:
486 return PixelFormat::ASTC_2D_4X4; 496 return PixelFormat::ASTC_2D_4X4;
487 case Tegra::Texture::TextureFormat::R16_G16: 497 case Tegra::Texture::TextureFormat::R16_G16:
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 70746a34e..272294c62 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -56,6 +56,8 @@ u32 BytesPerPixel(TextureFormat format) {
56 case TextureFormat::DXT45: 56 case TextureFormat::DXT45:
57 case TextureFormat::DXN2: 57 case TextureFormat::DXN2:
58 case TextureFormat::BC7U: 58 case TextureFormat::BC7U:
59 case TextureFormat::BC6H_UF16:
60 case TextureFormat::BC6H_SF16:
59 // In this case a 'pixel' actually refers to a 4x4 tile. 61 // In this case a 'pixel' actually refers to a 4x4 tile.
60 return 16; 62 return 16;
61 case TextureFormat::R32_G32_B32: 63 case TextureFormat::R32_G32_B32:
@@ -106,6 +108,8 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
106 case TextureFormat::DXN1: 108 case TextureFormat::DXN1:
107 case TextureFormat::DXN2: 109 case TextureFormat::DXN2:
108 case TextureFormat::BC7U: 110 case TextureFormat::BC7U:
111 case TextureFormat::BC6H_UF16:
112 case TextureFormat::BC6H_SF16:
109 case TextureFormat::ASTC_2D_4X4: 113 case TextureFormat::ASTC_2D_4X4:
110 case TextureFormat::A8R8G8B8: 114 case TextureFormat::A8R8G8B8:
111 case TextureFormat::A2B10G10R10: 115 case TextureFormat::A2B10G10R10: