From 26e575f4e0214b6d52e5616c984274e4049cf122 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 17 Feb 2025 13:20:47 +0000 Subject: [PATCH] Improve display of root buffers in D3D12 pipeline state view * When they're 'structured' but with no structure, still prefer the basic type declared in the shader reflection over the descriptor (which can't do better). --- qrenderdoc/Code/BufferFormatter.cpp | 2 +- renderdoc/driver/d3d12/d3d12_replay.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index 4d662348f..b9c5a1ed5 100644 --- a/qrenderdoc/Code/BufferFormatter.cpp +++ b/qrenderdoc/Code/BufferFormatter.cpp @@ -2511,7 +2511,7 @@ QString BufferFormatter::GetBufferFormatString(Packing::Rules pack, ResourceId s { const ShaderConstantType &desc = res.variableType; - if(viewFormat.type == ResourceFormatType::Undefined) + if(viewFormat.type == ResourceFormatType::Undefined || viewFormat.compType == CompType::Typeless) { if(desc.baseType == VarType::Unknown) { diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index e335bfad7..2a41b4199 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -1157,7 +1157,7 @@ void D3D12Replay::FillRootDescriptor(Descriptor &dst, const D3D12RenderState::Si // parameters from resource/view dst.resource = rm->GetOriginalID(src.id); dst.textureType = TextureType::Buffer; - dst.format = MakeResourceFormat(DXGI_FORMAT_R32_UINT); + dst.format = MakeResourceFormat(DXGI_FORMAT_R32_TYPELESS); dst.elementByteSize = sizeof(uint32_t); dst.byteOffset = src.offset; @@ -1175,7 +1175,7 @@ void D3D12Replay::FillRootDescriptor(Descriptor &dst, const D3D12RenderState::Si // parameters from resource/view dst.resource = rm->GetOriginalID(src.id); dst.textureType = TextureType::Buffer; - dst.format = MakeResourceFormat(DXGI_FORMAT_R32_UINT); + dst.format = MakeResourceFormat(DXGI_FORMAT_R32_TYPELESS); dst.elementByteSize = sizeof(uint32_t); dst.byteOffset = src.offset;