From cc9aec21355f07be8d18d4e312bf70cf138f0970 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 2 Oct 2020 14:19:06 +0100 Subject: [PATCH] Fix display of UINT casted textures on D3D12 --- renderdoc/driver/d3d12/d3d12_rendertexture.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/d3d12/d3d12_rendertexture.cpp b/renderdoc/driver/d3d12/d3d12_rendertexture.cpp index e533a8366..e7093c886 100644 --- a/renderdoc/driver/d3d12/d3d12_rendertexture.cpp +++ b/renderdoc/driver/d3d12/d3d12_rendertexture.cpp @@ -88,9 +88,9 @@ void D3D12DebugManager::PrepareTextureSampling(ID3D12Resource *resource, CompTyp if(IsDepthAndStencilFormat(resourceDesc.Format)) resType++; - if(IsUIntFormat(resourceDesc.Format)) + if(IsUIntFormat(srvDesc.Format)) srvOffset += 10; - if(IsIntFormat(resourceDesc.Format)) + if(IsIntFormat(srvDesc.Format)) srvOffset += 20; D3D12_RESOURCE_STATES realResourceState = @@ -471,9 +471,11 @@ bool D3D12Replay::RenderTextureInternal(D3D12_CPU_DESCRIPTOR_HANDLE rtv, Texture if(cfg.overlay == DebugOverlay::Clipping) pixelData.OutputDisplayFormat |= TEXDISPLAY_CLIPPING; - if(IsUIntFormat(resourceDesc.Format)) + DXGI_FORMAT fmt = GetTypedFormat(resourceDesc.Format, cfg.typeCast); + + if(IsUIntFormat(fmt)) pixelData.OutputDisplayFormat |= TEXDISPLAY_UINT_TEX; - else if(IsIntFormat(resourceDesc.Format)) + else if(IsIntFormat(fmt)) pixelData.OutputDisplayFormat |= TEXDISPLAY_SINT_TEX; // Check both the resource format and view format for sRGB