summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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/surface.cpp8
-rw-r--r--src/video_core/surface.h16
4 files changed, 22 insertions, 5 deletions
diff --git a/src/video_core/morton.cpp b/src/video_core/morton.cpp
index fe5f08ace..2f2fe6859 100644
--- a/src/video_core/morton.cpp
+++ b/src/video_core/morton.cpp
@@ -112,6 +112,7 @@ static constexpr ConversionArray morton_to_linear_fns = {
112 MortonCopy<true, PixelFormat::ASTC_2D_8X6_SRGB>, 112 MortonCopy<true, PixelFormat::ASTC_2D_8X6_SRGB>,
113 MortonCopy<true, PixelFormat::ASTC_2D_6X5>, 113 MortonCopy<true, PixelFormat::ASTC_2D_6X5>,
114 MortonCopy<true, PixelFormat::ASTC_2D_6X5_SRGB>, 114 MortonCopy<true, PixelFormat::ASTC_2D_6X5_SRGB>,
115 MortonCopy<true, PixelFormat::E5B9G9R9F>,
115 MortonCopy<true, PixelFormat::Z32F>, 116 MortonCopy<true, PixelFormat::Z32F>,
116 MortonCopy<true, PixelFormat::Z16>, 117 MortonCopy<true, PixelFormat::Z16>,
117 MortonCopy<true, PixelFormat::Z24S8>, 118 MortonCopy<true, PixelFormat::Z24S8>,
@@ -192,6 +193,7 @@ static constexpr ConversionArray linear_to_morton_fns = {
192 nullptr, 193 nullptr,
193 nullptr, 194 nullptr,
194 nullptr, 195 nullptr,
196 MortonCopy<false, PixelFormat::E5B9G9R9F>,
195 MortonCopy<false, PixelFormat::Z32F>, 197 MortonCopy<false, PixelFormat::Z32F>,
196 MortonCopy<false, PixelFormat::Z16>, 198 MortonCopy<false, PixelFormat::Z16>,
197 MortonCopy<false, PixelFormat::Z24S8>, 199 MortonCopy<false, PixelFormat::Z24S8>,
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index 2f9bfd7e4..55b3e58b2 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -131,6 +131,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
131 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_8X6_SRGB 131 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_8X6_SRGB
132 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_6X5 132 {GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_6X5
133 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_6X5_SRGB 133 {GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE, ComponentType::UNorm, false}, // ASTC_2D_6X5_SRGB
134 {GL_RGB9_E5, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, ComponentType::Float, false}, // E5B9G9R9F
134 135
135 // Depth formats 136 // Depth formats
136 {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, ComponentType::Float, false}, // Z32F 137 {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, ComponentType::Float, false}, // Z32F
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 9a3c05288..621136b6e 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -315,6 +315,14 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
315 break; 315 break;
316 } 316 }
317 break; 317 break;
318 case Tegra::Texture::TextureFormat::E5B9G9R9_SHAREDEXP:
319 switch (component_type) {
320 case Tegra::Texture::ComponentType::FLOAT:
321 return PixelFormat::E5B9G9R9F;
322 default:
323 break;
324 }
325 break;
318 case Tegra::Texture::TextureFormat::ZF32: 326 case Tegra::Texture::TextureFormat::ZF32:
319 return PixelFormat::Z32F; 327 return PixelFormat::Z32F;
320 case Tegra::Texture::TextureFormat::Z16: 328 case Tegra::Texture::TextureFormat::Z16:
diff --git a/src/video_core/surface.h b/src/video_core/surface.h
index 97668f802..d3bcd38c5 100644
--- a/src/video_core/surface.h
+++ b/src/video_core/surface.h
@@ -86,19 +86,20 @@ enum class PixelFormat {
86 ASTC_2D_8X6_SRGB = 68, 86 ASTC_2D_8X6_SRGB = 68,
87 ASTC_2D_6X5 = 69, 87 ASTC_2D_6X5 = 69,
88 ASTC_2D_6X5_SRGB = 70, 88 ASTC_2D_6X5_SRGB = 70,
89 E5B9G9R9F = 71,
89 90
90 MaxColorFormat, 91 MaxColorFormat,
91 92
92 // Depth formats 93 // Depth formats
93 Z32F = 71, 94 Z32F = 72,
94 Z16 = 72, 95 Z16 = 73,
95 96
96 MaxDepthFormat, 97 MaxDepthFormat,
97 98
98 // DepthStencil formats 99 // DepthStencil formats
99 Z24S8 = 73, 100 Z24S8 = 74,
100 S8Z24 = 74, 101 S8Z24 = 75,
101 Z32FS8 = 75, 102 Z32FS8 = 76,
102 103
103 MaxDepthStencilFormat, 104 MaxDepthStencilFormat,
104 105
@@ -207,6 +208,7 @@ constexpr std::array<u32, MaxPixelFormat> compression_factor_shift_table = {{
207 2, // ASTC_2D_8X6_SRGB 208 2, // ASTC_2D_8X6_SRGB
208 2, // ASTC_2D_6X5 209 2, // ASTC_2D_6X5
209 2, // ASTC_2D_6X5_SRGB 210 2, // ASTC_2D_6X5_SRGB
211 0, // E5B9G9R9F
210 0, // Z32F 212 0, // Z32F
211 0, // Z16 213 0, // Z16
212 0, // Z24S8 214 0, // Z24S8
@@ -302,6 +304,7 @@ constexpr std::array<u32, MaxPixelFormat> block_width_table = {{
302 8, // ASTC_2D_8X6_SRGB 304 8, // ASTC_2D_8X6_SRGB
303 6, // ASTC_2D_6X5 305 6, // ASTC_2D_6X5
304 6, // ASTC_2D_6X5_SRGB 306 6, // ASTC_2D_6X5_SRGB
307 1, // E5B9G9R9F
305 1, // Z32F 308 1, // Z32F
306 1, // Z16 309 1, // Z16
307 1, // Z24S8 310 1, // Z24S8
@@ -389,6 +392,7 @@ constexpr std::array<u32, MaxPixelFormat> block_height_table = {{
389 6, // ASTC_2D_8X6_SRGB 392 6, // ASTC_2D_8X6_SRGB
390 5, // ASTC_2D_6X5 393 5, // ASTC_2D_6X5
391 5, // ASTC_2D_6X5_SRGB 394 5, // ASTC_2D_6X5_SRGB
395 1, // E5B9G9R9F
392 1, // Z32F 396 1, // Z32F
393 1, // Z16 397 1, // Z16
394 1, // Z24S8 398 1, // Z24S8
@@ -476,6 +480,7 @@ constexpr std::array<u32, MaxPixelFormat> bpp_table = {{
476 128, // ASTC_2D_8X6_SRGB 480 128, // ASTC_2D_8X6_SRGB
477 128, // ASTC_2D_6X5 481 128, // ASTC_2D_6X5
478 128, // ASTC_2D_6X5_SRGB 482 128, // ASTC_2D_6X5_SRGB
483 32, // E5B9G9R9F
479 32, // Z32F 484 32, // Z32F
480 16, // Z16 485 16, // Z16
481 32, // Z24S8 486 32, // Z24S8
@@ -578,6 +583,7 @@ constexpr std::array<SurfaceCompression, MaxPixelFormat> compression_type_table
578 SurfaceCompression::Converted, // ASTC_2D_8X6_SRGB 583 SurfaceCompression::Converted, // ASTC_2D_8X6_SRGB
579 SurfaceCompression::Converted, // ASTC_2D_6X5 584 SurfaceCompression::Converted, // ASTC_2D_6X5
580 SurfaceCompression::Converted, // ASTC_2D_6X5_SRGB 585 SurfaceCompression::Converted, // ASTC_2D_6X5_SRGB
586 SurfaceCompression::None, // E5B9G9R9F
581 SurfaceCompression::None, // Z32F 587 SurfaceCompression::None, // Z32F
582 SurfaceCompression::None, // Z16 588 SurfaceCompression::None, // Z16
583 SurfaceCompression::None, // Z24S8 589 SurfaceCompression::None, // Z24S8