diff options
author | bunnei <bunneidev@gmail.com> | 2019-04-14 04:14:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-14 04:14:51 +0200 |
commit | c9454c8422e746285df7d947eeb0b339f02d719b (patch) | |
tree | 57338e73fd2ef8723a9e2c3b5c22b985389660e9 /src/video_core/renderer_opengl | |
parent | Merge pull request #2357 from zarroboogs/force-30fps-mode (diff) | |
parent | Implement Texture Format ZF32_X24S8. (diff) | |
download | yuzu-c9454c8422e746285df7d947eeb0b339f02d719b.tar yuzu-c9454c8422e746285df7d947eeb0b339f02d719b.tar.gz yuzu-c9454c8422e746285df7d947eeb0b339f02d719b.tar.bz2 yuzu-c9454c8422e746285df7d947eeb0b339f02d719b.tar.lz yuzu-c9454c8422e746285df7d947eeb0b339f02d719b.tar.xz yuzu-c9454c8422e746285df7d947eeb0b339f02d719b.tar.zst yuzu-c9454c8422e746285df7d947eeb0b339f02d719b.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 55b6d8591..f2ffc4710 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -112,11 +112,26 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only, params.pixel_format = PixelFormatFromTextureFormat(config.tic.format, config.tic.r_type.Value(), params.srgb_conversion); - if (params.pixel_format == PixelFormat::R16U && config.tsc.depth_compare_enabled) { + if (config.tsc.depth_compare_enabled) { // Some titles create a 'R16U' (normalized 16-bit) texture with depth_compare enabled, // then attempt to sample from it via a shadow sampler. Convert format to Z16 (which also // causes GetFormatType to properly return 'Depth' below). - params.pixel_format = PixelFormat::Z16; + if (GetFormatType(params.pixel_format) == SurfaceType::ColorTexture) { + switch (params.pixel_format) { + case PixelFormat::R16S: + case PixelFormat::R16U: + case PixelFormat::R16F: + params.pixel_format = PixelFormat::Z16; + break; + case PixelFormat::R32F: + params.pixel_format = PixelFormat::Z32F; + break; + default: + LOG_WARNING(HW_GPU, "Color texture format being used with depth compare: {}", + static_cast<u32>(params.pixel_format)); + break; + } + } } params.component_type = ComponentTypeFromTexture(config.tic.r_type.Value()); |