diff --git a/qrenderdoc/Windows/DescriptorViewer.cpp b/qrenderdoc/Windows/DescriptorViewer.cpp index b2be09f05..38114b756 100644 --- a/qrenderdoc/Windows/DescriptorViewer.cpp +++ b/qrenderdoc/Windows/DescriptorViewer.cpp @@ -997,6 +997,12 @@ public: if(row == 0) return col == 0 ? lit("Visibility") : ToQStr(param.visibility); + if(row == 1) + return col == 0 ? lit("Register Space") : Formatter::Format(param.space); + + if(row == 2) + return col == 0 ? lit("Register") : Formatter::Format(param.reg); + return QVariant(); } @@ -1178,7 +1184,7 @@ private: // the number of rows in a range before the descriptors: category, table offset, count static const int RangeFixedRowCount = 3; // visibility only - static const int DescParameterFixedRowCount = 1; + static const int DescParameterFixedRowCount = 3; // visibility, and 3 forms of interpretation of constants (float, decimal, hex) static const int ConstParameterFixedRowCount = 4; // 3 for space/reg/visibility, plus sampler properties diff --git a/renderdoc/api/replay/d3d12_pipestate.h b/renderdoc/api/replay/d3d12_pipestate.h index 82b0e2cb0..33bc56a92 100644 --- a/renderdoc/api/replay/d3d12_pipestate.h +++ b/renderdoc/api/replay/d3d12_pipestate.h @@ -625,13 +625,18 @@ struct RootParam bool operator==(const RootParam &o) const { - return visibility == o.visibility && heap == o.heap && heapByteOffset == o.heapByteOffset && - tableRanges == o.tableRanges && descriptor == o.descriptor && constants == o.constants; + return visibility == o.visibility && space == o.space && reg == o.reg && heap == o.heap && + heapByteOffset == o.heapByteOffset && tableRanges == o.tableRanges && + descriptor == o.descriptor && constants == o.constants; } bool operator<(const RootParam &o) const { if(!(visibility == o.visibility)) return visibility < o.visibility; + if(!(space == o.space)) + return space < o.space; + if(!(reg == o.reg)) + return reg < o.reg; if(!(heap == o.heap)) return heap < o.heap; if(!(heapByteOffset == o.heapByteOffset)) @@ -651,6 +656,18 @@ struct RootParam )"); ShaderStageMask visibility; + DOCUMENT(R"(For a root parameter, the register space of the binding. + +:type: int +)"); + uint32_t space = 0; + + DOCUMENT(R"(For a root parameter, the register of the binding. + +:type: int +)"); + uint32_t reg = 0; + DOCUMENT(R"(For a root constant parameter, the words defined. :type: bytes diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 231c68ea9..80ad8eb2b 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -1409,6 +1409,8 @@ void D3D12Replay::SavePipelineState(uint32_t eventId) case D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS: { dst.constants.resize(src.Constants.Num32BitValues * 4); + dst.space = src.Constants.RegisterSpace; + dst.reg = src.Constants.ShaderRegister; if(i < rootElems.size()) { @@ -1421,27 +1423,32 @@ void D3D12Replay::SavePipelineState(uint32_t eventId) case D3D12_ROOT_PARAMETER_TYPE_CBV: { dst.descriptor.type = DescriptorType::ConstantBuffer; + dst.space = src.Descriptor.RegisterSpace; + dst.reg = src.Descriptor.ShaderRegister; if(i < rootElems.size()) FillRootDescriptor(dst.descriptor, rootElems[i]); break; + } + case D3D12_ROOT_PARAMETER_TYPE_SRV: + { + dst.descriptor.type = DescriptorType::Buffer; + dst.space = src.Descriptor.RegisterSpace; + dst.reg = src.Descriptor.ShaderRegister; - case D3D12_ROOT_PARAMETER_TYPE_SRV: - { - dst.descriptor.type = DescriptorType::Buffer; + if(i < rootElems.size()) + FillRootDescriptor(dst.descriptor, rootElems[i]); + break; + } + case D3D12_ROOT_PARAMETER_TYPE_UAV: + { + dst.descriptor.type = DescriptorType::ReadWriteBuffer; + dst.space = src.Descriptor.RegisterSpace; + dst.reg = src.Descriptor.ShaderRegister; - if(i < rootElems.size()) - FillRootDescriptor(dst.descriptor, rootElems[i]); - break; - } - case D3D12_ROOT_PARAMETER_TYPE_UAV: - { - dst.descriptor.type = DescriptorType::ReadWriteBuffer; - - if(i < rootElems.size()) - FillRootDescriptor(dst.descriptor, rootElems[i]); - break; - } + if(i < rootElems.size()) + FillRootDescriptor(dst.descriptor, rootElems[i]); + break; } } diff --git a/renderdoc/replay/renderdoc_serialise.inl b/renderdoc/replay/renderdoc_serialise.inl index 025e738be..7ae4b4a4f 100644 --- a/renderdoc/replay/renderdoc_serialise.inl +++ b/renderdoc/replay/renderdoc_serialise.inl @@ -1616,7 +1616,7 @@ void DoSerialise(SerialiserType &ser, D3D12Pipe::RootParam &el) SERIALISE_MEMBER(heapByteOffset); SERIALISE_MEMBER(tableRanges); - SIZE_CHECK(152); + SIZE_CHECK(160); } template