From daf2504d310558e0a74e6eb321ab0811ba6e5e55 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 24 Jul 2018 20:41:40 -0500 Subject: GPU: Implemented the Z32_S8_X24 depth buffer format. --- src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 5 ++++- src/video_core/renderer_opengl/gl_rasterizer_cache.h | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/video_core/renderer_opengl') 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 tex_form {GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT, ComponentType::Float, false}, // Z32F {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // Z16 + {GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, + ComponentType::Float, false}, // Z32FS8 }}; static const FormatTuple& GetFormatTuple(PixelFormat pixel_format, ComponentType component_type) { @@ -209,7 +211,7 @@ static constexpr std::array, MortonCopy, MortonCopy, MortonCopy, MortonCopy, MortonCopy, - MortonCopy, + MortonCopy, MortonCopy, }; static constexpr std::array, MortonCopy, MortonCopy, + MortonCopy, }; // 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 { S8Z24 = 22, Z32F = 23, Z16 = 24, + Z32FS8 = 25, MaxDepthStencilFormat, @@ -113,6 +114,7 @@ struct SurfaceParams { 1, // S8Z24 1, // Z32F 1, // Z16 + 1, // Z32FS8 }}; ASSERT(static_cast(format) < compression_factor_table.size()); @@ -149,6 +151,7 @@ struct SurfaceParams { 32, // S8Z24 32, // Z32F 16, // Z16 + 64, // Z32FS8 }}; ASSERT(static_cast(format) < bpp_table.size()); @@ -169,6 +172,8 @@ struct SurfaceParams { return PixelFormat::Z32F; case Tegra::DepthFormat::Z16_UNORM: return PixelFormat::Z16; + case Tegra::DepthFormat::Z32_S8_X24_FLOAT: + return PixelFormat::Z32FS8; default: LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast(format)); UNREACHABLE(); @@ -325,6 +330,8 @@ struct SurfaceParams { return Tegra::DepthFormat::Z32_FLOAT; case PixelFormat::Z16: return Tegra::DepthFormat::Z16_UNORM; + case PixelFormat::Z32FS8: + return Tegra::DepthFormat::Z32_S8_X24_FLOAT; default: LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast(format)); UNREACHABLE(); @@ -382,6 +389,7 @@ struct SurfaceParams { case Tegra::DepthFormat::Z24_S8_UNORM: return ComponentType::UNorm; case Tegra::DepthFormat::Z32_FLOAT: + case Tegra::DepthFormat::Z32_S8_X24_FLOAT: return ComponentType::Float; default: LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast(format)); -- cgit v1.2.3