From 01873eddcce0ab4fd7da5ef38cd6eaa4249fc054 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 16 May 2020 18:14:27 +0100 Subject: [PATCH] Remap SNORM/SRGB textures to RGBA16F * Since we restrict output formats on remap to basic float/uint/sint, for 1-byte formats this ends up mapping to UNORM. Instead promote straight to RGBA16F to ensure we have the precision --- renderdoc/core/replay_proxy.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index 1e89786dc..2c522c028 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -2293,11 +2293,23 @@ void ReplayProxy::RemapProxyTextureIfNeeded(TextureDescription &tex, GetTextureD else { if(tex.format.compByteWidth == 1) + { params.remap = RemapTexture::RGBA8; + + if(tex.format.compType == CompType::SNorm || tex.format.compType == CompType::UNormSRGB) + { + params.remap = RemapTexture::RGBA16; + tex.format.compType = CompType::Float; + } + } else if(tex.format.compByteWidth == 2) + { params.remap = RemapTexture::RGBA16; + } else + { params.remap = RemapTexture::RGBA32; + } // always remap depth to RGBA32F, because D16_UNORM will lose precision if remapped to R16_FLOAT if(tex.format.compType == CompType::Depth)