diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/gpu.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 8 | ||||
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 3 |
4 files changed, 16 insertions, 1 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 58501ca8b..a0e5e3365 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -33,6 +33,7 @@ enum class DepthFormat : u32 { | |||
| 33 | Z24_X8_UNORM = 0x15, | 33 | Z24_X8_UNORM = 0x15, |
| 34 | Z24_S8_UNORM = 0x16, | 34 | Z24_S8_UNORM = 0x16, |
| 35 | Z24_C8_UNORM = 0x18, | 35 | Z24_C8_UNORM = 0x18, |
| 36 | Z32_S8_X24_FLOAT = 0x19, | ||
| 36 | }; | 37 | }; |
| 37 | 38 | ||
| 38 | /// Returns the number of bytes per pixel of each rendertarget format. | 39 | /// Returns the number of bytes per pixel of each rendertarget format. |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 0f5006383..91ce0357b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -122,6 +122,8 @@ static constexpr std::array<FormatTuple, SurfaceParams::MaxPixelFormat> tex_form | |||
| 122 | {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, ComponentType::Float, false}, // Z32F | 122 | {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, ComponentType::Float, false}, // Z32F |
| 123 | {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, ComponentType::UNorm, | 123 | {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, ComponentType::UNorm, |
| 124 | false}, // Z16 | 124 | false}, // Z16 |
| 125 | {GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, | ||
| 126 | ComponentType::Float, false}, // Z32FS8 | ||
| 125 | }}; | 127 | }}; |
| 126 | 128 | ||
| 127 | static const FormatTuple& GetFormatTuple(PixelFormat pixel_format, ComponentType component_type) { | 129 | static const FormatTuple& GetFormatTuple(PixelFormat pixel_format, ComponentType component_type) { |
| @@ -209,7 +211,7 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr), | |||
| 209 | MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::R16F>, | 211 | MortonCopy<true, PixelFormat::R32F>, MortonCopy<true, PixelFormat::R16F>, |
| 210 | MortonCopy<true, PixelFormat::R16UNORM>, MortonCopy<true, PixelFormat::Z24S8>, | 212 | MortonCopy<true, PixelFormat::R16UNORM>, MortonCopy<true, PixelFormat::Z24S8>, |
| 211 | MortonCopy<true, PixelFormat::S8Z24>, MortonCopy<true, PixelFormat::Z32F>, | 213 | MortonCopy<true, PixelFormat::S8Z24>, MortonCopy<true, PixelFormat::Z32F>, |
| 212 | MortonCopy<true, PixelFormat::Z16>, | 214 | MortonCopy<true, PixelFormat::Z16>, MortonCopy<true, PixelFormat::Z32FS8>, |
| 213 | }; | 215 | }; |
| 214 | 216 | ||
| 215 | static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr), | 217 | static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr), |
| @@ -241,6 +243,7 @@ static constexpr std::array<void (*)(u32, u32, u32, u8*, Tegra::GPUVAddr), | |||
| 241 | MortonCopy<false, PixelFormat::S8Z24>, | 243 | MortonCopy<false, PixelFormat::S8Z24>, |
| 242 | MortonCopy<false, PixelFormat::Z32F>, | 244 | MortonCopy<false, PixelFormat::Z32F>, |
| 243 | MortonCopy<false, PixelFormat::Z16>, | 245 | MortonCopy<false, PixelFormat::Z16>, |
| 246 | MortonCopy<false, PixelFormat::Z32FS8>, | ||
| 244 | }; | 247 | }; |
| 245 | 248 | ||
| 246 | // Allocate an uninitialized texture of appropriate size and format for the surface | 249 | // Allocate an uninitialized texture of appropriate size and format for the surface |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index e1d3670d9..7785b7df4 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -51,6 +51,7 @@ struct SurfaceParams { | |||
| 51 | S8Z24 = 22, | 51 | S8Z24 = 22, |
| 52 | Z32F = 23, | 52 | Z32F = 23, |
| 53 | Z16 = 24, | 53 | Z16 = 24, |
| 54 | Z32FS8 = 25, | ||
| 54 | 55 | ||
| 55 | MaxDepthStencilFormat, | 56 | MaxDepthStencilFormat, |
| 56 | 57 | ||
| @@ -113,6 +114,7 @@ struct SurfaceParams { | |||
| 113 | 1, // S8Z24 | 114 | 1, // S8Z24 |
| 114 | 1, // Z32F | 115 | 1, // Z32F |
| 115 | 1, // Z16 | 116 | 1, // Z16 |
| 117 | 1, // Z32FS8 | ||
| 116 | }}; | 118 | }}; |
| 117 | 119 | ||
| 118 | ASSERT(static_cast<size_t>(format) < compression_factor_table.size()); | 120 | ASSERT(static_cast<size_t>(format) < compression_factor_table.size()); |
| @@ -149,6 +151,7 @@ struct SurfaceParams { | |||
| 149 | 32, // S8Z24 | 151 | 32, // S8Z24 |
| 150 | 32, // Z32F | 152 | 32, // Z32F |
| 151 | 16, // Z16 | 153 | 16, // Z16 |
| 154 | 64, // Z32FS8 | ||
| 152 | }}; | 155 | }}; |
| 153 | 156 | ||
| 154 | ASSERT(static_cast<size_t>(format) < bpp_table.size()); | 157 | ASSERT(static_cast<size_t>(format) < bpp_table.size()); |
| @@ -169,6 +172,8 @@ struct SurfaceParams { | |||
| 169 | return PixelFormat::Z32F; | 172 | return PixelFormat::Z32F; |
| 170 | case Tegra::DepthFormat::Z16_UNORM: | 173 | case Tegra::DepthFormat::Z16_UNORM: |
| 171 | return PixelFormat::Z16; | 174 | return PixelFormat::Z16; |
| 175 | case Tegra::DepthFormat::Z32_S8_X24_FLOAT: | ||
| 176 | return PixelFormat::Z32FS8; | ||
| 172 | default: | 177 | default: |
| 173 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); | 178 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); |
| 174 | UNREACHABLE(); | 179 | UNREACHABLE(); |
| @@ -325,6 +330,8 @@ struct SurfaceParams { | |||
| 325 | return Tegra::DepthFormat::Z32_FLOAT; | 330 | return Tegra::DepthFormat::Z32_FLOAT; |
| 326 | case PixelFormat::Z16: | 331 | case PixelFormat::Z16: |
| 327 | return Tegra::DepthFormat::Z16_UNORM; | 332 | return Tegra::DepthFormat::Z16_UNORM; |
| 333 | case PixelFormat::Z32FS8: | ||
| 334 | return Tegra::DepthFormat::Z32_S8_X24_FLOAT; | ||
| 328 | default: | 335 | default: |
| 329 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); | 336 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); |
| 330 | UNREACHABLE(); | 337 | UNREACHABLE(); |
| @@ -382,6 +389,7 @@ struct SurfaceParams { | |||
| 382 | case Tegra::DepthFormat::Z24_S8_UNORM: | 389 | case Tegra::DepthFormat::Z24_S8_UNORM: |
| 383 | return ComponentType::UNorm; | 390 | return ComponentType::UNorm; |
| 384 | case Tegra::DepthFormat::Z32_FLOAT: | 391 | case Tegra::DepthFormat::Z32_FLOAT: |
| 392 | case Tegra::DepthFormat::Z32_S8_X24_FLOAT: | ||
| 385 | return ComponentType::Float; | 393 | return ComponentType::Float; |
| 386 | default: | 394 | default: |
| 387 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); | 395 | LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format)); |
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 970c06e71..50c5a56f6 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -90,6 +90,8 @@ static u32 DepthBytesPerPixel(DepthFormat format) { | |||
| 90 | case DepthFormat::Z24_S8_UNORM: | 90 | case DepthFormat::Z24_S8_UNORM: |
| 91 | case DepthFormat::Z32_FLOAT: | 91 | case DepthFormat::Z32_FLOAT: |
| 92 | return 4; | 92 | return 4; |
| 93 | case DepthFormat::Z32_S8_X24_FLOAT: | ||
| 94 | return 8; | ||
| 93 | default: | 95 | default: |
| 94 | UNIMPLEMENTED_MSG("Format not implemented"); | 96 | UNIMPLEMENTED_MSG("Format not implemented"); |
| 95 | break; | 97 | break; |
| @@ -150,6 +152,7 @@ std::vector<u8> UnswizzleDepthTexture(VAddr address, DepthFormat format, u32 wid | |||
| 150 | case DepthFormat::S8_Z24_UNORM: | 152 | case DepthFormat::S8_Z24_UNORM: |
| 151 | case DepthFormat::Z24_S8_UNORM: | 153 | case DepthFormat::Z24_S8_UNORM: |
| 152 | case DepthFormat::Z32_FLOAT: | 154 | case DepthFormat::Z32_FLOAT: |
| 155 | case DepthFormat::Z32_S8_X24_FLOAT: | ||
| 153 | CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data, | 156 | CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data, |
| 154 | unswizzled_data.data(), true, block_height); | 157 | unswizzled_data.data(), true, block_height); |
| 155 | break; | 158 | break; |