summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar heapo2018-12-18 11:34:51 -0800
committerGravatar heapo2018-12-18 11:34:51 -0800
commit37280cf5559b8a6b2744360cdbbee177a783fd1f (patch)
treee3f2c57bdd3fd95e7952ace2b7903f19a0172aa9 /src
parentMerge pull request #1913 from MerryMage/default-fpcr (diff)
downloadyuzu-37280cf5559b8a6b2744360cdbbee177a783fd1f.tar.gz
yuzu-37280cf5559b8a6b2744360cdbbee177a783fd1f.tar.xz
yuzu-37280cf5559b8a6b2744360cdbbee177a783fd1f.zip
Texture format fixes: Flag RGBA16UI as GL_RGBA_INTEGER format, and interpret R16U as Z16 when depth_compare is enabled.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 5f4cdd119..7ea07631a 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -101,8 +101,18 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only,
101 params.srgb_conversion = config.tic.IsSrgbConversionEnabled(); 101 params.srgb_conversion = config.tic.IsSrgbConversionEnabled();
102 params.pixel_format = PixelFormatFromTextureFormat(config.tic.format, config.tic.r_type.Value(), 102 params.pixel_format = PixelFormatFromTextureFormat(config.tic.format, config.tic.r_type.Value(),
103 params.srgb_conversion); 103 params.srgb_conversion);
104
105 if (params.pixel_format == PixelFormat::R16U && config.tsc.depth_compare_enabled) {
106 // Some titles create a 'R16U' (normalized 16-bit) texture with depth_compare enabled,
107 // then attempt to sample from it via a shadow sampler. Convert format to Z16 (which also
108 // causes GetFormatType to properly return 'Depth' below).
109 params.pixel_format = PixelFormat::Z16;
110 }
111
104 params.component_type = ComponentTypeFromTexture(config.tic.r_type.Value()); 112 params.component_type = ComponentTypeFromTexture(config.tic.r_type.Value());
105 params.type = GetFormatType(params.pixel_format); 113 params.type = GetFormatType(params.pixel_format);
114 UNIMPLEMENTED_IF(params.type == SurfaceType::ColorTexture && config.tsc.depth_compare_enabled);
115
106 params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format)); 116 params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format));
107 params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); 117 params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format));
108 params.unaligned_height = config.tic.Height(); 118 params.unaligned_height = config.tic.Height();
@@ -257,7 +267,7 @@ static constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex
257 {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, ComponentType::UInt, false}, // R8UI 267 {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE, ComponentType::UInt, false}, // R8UI
258 {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, ComponentType::Float, false}, // RGBA16F 268 {GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT, ComponentType::Float, false}, // RGBA16F
259 {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // RGBA16U 269 {GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT, ComponentType::UNorm, false}, // RGBA16U
260 {GL_RGBA16UI, GL_RGBA, GL_UNSIGNED_SHORT, ComponentType::UInt, false}, // RGBA16UI 270 {GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, ComponentType::UInt, false}, // RGBA16UI
261 {GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, ComponentType::Float, 271 {GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, ComponentType::Float,
262 false}, // R11FG11FB10F 272 false}, // R11FG11FB10F
263 {GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT, ComponentType::UInt, false}, // RGBA32UI 273 {GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT, ComponentType::UInt, false}, // RGBA32UI