From 8e69038ebc6bfca6bd2c479415f567f0bd220c86 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Sun, 1 Dec 2024 14:15:02 +0000 Subject: [PATCH] Extend DXDebug::BindingSlot to support direct access heap bindings Add new members HeapDescriptorType heapType; uint32_t heapIndex; --- renderdoc/driver/shaders/dxbc/dx_debug.h | 37 ++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/renderdoc/driver/shaders/dxbc/dx_debug.h b/renderdoc/driver/shaders/dxbc/dx_debug.h index 6a3ae2a9e..32fd13910 100644 --- a/renderdoc/driver/shaders/dxbc/dx_debug.h +++ b/renderdoc/driver/shaders/dxbc/dx_debug.h @@ -80,21 +80,52 @@ enum class GatherChannel : uint8_t Alpha = 3, }; +enum class HeapDescriptorType : uint8_t +{ + NoHeap = 0, + CBV_SRV_UAV, + Sampler, +}; + struct BindingSlot { - BindingSlot() : shaderRegister(UINT32_MAX), registerSpace(UINT32_MAX) {} + BindingSlot() + : shaderRegister(UINT32_MAX), + registerSpace(UINT32_MAX), + heapType(HeapDescriptorType::NoHeap), + descriptorIndex(UINT32_MAX) + { + } BindingSlot(uint32_t shaderReg, uint32_t regSpace) - : shaderRegister(shaderReg), registerSpace(regSpace) + : shaderRegister(shaderReg), + registerSpace(regSpace), + heapType(HeapDescriptorType::NoHeap), + descriptorIndex(UINT32_MAX) + { + } + BindingSlot(HeapDescriptorType type, uint32_t index) + : shaderRegister(UINT32_MAX), registerSpace(UINT32_MAX), heapType(type), descriptorIndex(index) { } bool operator<(const BindingSlot &o) const { if(registerSpace != o.registerSpace) return registerSpace < o.registerSpace; - return shaderRegister < o.shaderRegister; + if(shaderRegister != o.shaderRegister) + return shaderRegister < o.shaderRegister; + if(heapType != o.heapType) + return heapType < o.heapType; + return descriptorIndex < o.descriptorIndex; + } + bool operator==(const BindingSlot &o) const + { + return registerSpace == o.registerSpace && shaderRegister == o.shaderRegister && + heapType == o.heapType && descriptorIndex == o.descriptorIndex; } uint32_t shaderRegister; uint32_t registerSpace; + HeapDescriptorType heapType; + uint32_t descriptorIndex; }; struct SampleGatherResourceData