diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp index da72fb7fa..d0893ce75 100644 --- a/renderdoc/core/replay_proxy.cpp +++ b/renderdoc/core/replay_proxy.cpp @@ -2515,7 +2515,7 @@ void ReplayProxy::RemapProxyTextureIfNeeded(TextureDescription &tex, GetTextureD params.remap = RemapTexture::RGBA32; tex.format.compCount = 4; tex.format.compByteWidth = 4; - tex.format.compType = CompType::Float; + params.typeCast = tex.format.compType = CompType::Float; tex.format.type = ResourceFormatType::Regular; tex.creationFlags &= ~TextureCategory::DepthTarget; return; @@ -2566,8 +2566,14 @@ void ReplayProxy::RemapProxyTextureIfNeeded(TextureDescription &tex, GetTextureD case ResourceFormatType::R5G5B5A1: case ResourceFormatType::R4G4: case ResourceFormatType::R4G4B4A4: - case ResourceFormatType::ETC2: params.remap = RemapTexture::RGBA8; break; - case ResourceFormatType::R10G10B10A2: params.remap = RemapTexture::RGBA16; break; + case ResourceFormatType::ETC2: + params.remap = RemapTexture::RGBA8; + tex.format.compType = CompType::UNorm; + break; + case ResourceFormatType::R10G10B10A2: + params.remap = RemapTexture::RGBA16; + tex.format.compType = CompType::Float; + break; default: RDCERR("Don't know how to remap resource format type %u, falling back to RGBA32", tex.format.type); @@ -2605,6 +2611,8 @@ void ReplayProxy::RemapProxyTextureIfNeeded(TextureDescription &tex, GetTextureD } } + params.typeCast = tex.format.compType; + tex.format.SetBGRAOrder(false); tex.format.type = ResourceFormatType::Regular; tex.format.compCount = 4; @@ -2677,6 +2685,8 @@ void ReplayProxy::EnsureTexCached(ResourceId &texid, CompType &typeCast, const S GetTextureDataParams params = proxy.params; + if(typeCast == CompType::Typeless) + typeCast = params.typeCast; params.typeCast = typeCast; params.standardLayout = true; @@ -2695,7 +2705,11 @@ void ReplayProxy::EnsureTexCached(ResourceId &texid, CompType &typeCast, const S } if(proxyit->second.params.remap != RemapTexture::NoRemap) + { typeCast = BaseRemapType(proxyit->second.params.remap, typeCast); + if(typeCast == CompType::Typeless) + typeCast = proxyit->second.params.typeCast; + } // change texid to the proxy texture's ID for passing to our proxy renderer texid = proxyit->second.id; diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 17ac4774d..9f9d40146 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -2044,13 +2044,15 @@ bool D3D11Replay::GetHistogram(ResourceId texid, const Subresource &sub, CompTyp int srvOffset = 0; int intIdx = 0; - if(IsUIntFormat(details.texFmt)) + DXGI_FORMAT fmt = GetTypedFormat(details.texFmt, typeCast); + + if(IsUIntFormat(fmt)) { cdata.HistogramFlags |= TEXDISPLAY_UINT_TEX; srvOffset = 10; intIdx = 1; } - if(IsIntFormat(details.texFmt)) + if(IsIntFormat(fmt)) { cdata.HistogramFlags |= TEXDISPLAY_SINT_TEX; srvOffset = 20;