diff --git a/renderdoc/data/hlsl/misc.hlsl b/renderdoc/data/hlsl/misc.hlsl index e1b807daf..0e09a5531 100644 --- a/renderdoc/data/hlsl/misc.hlsl +++ b/renderdoc/data/hlsl/misc.hlsl @@ -143,10 +143,7 @@ cbuffer executepatchdata : register(b0) uint4 argOffsets[32]; }; -cbuffer countbuffer : register(b1) -{ - uint numExecutes; -}; +StructuredBuffer numExecutes : register(t1); cbuffer countbuffer : register(b2) { @@ -183,7 +180,7 @@ GPUAddress PatchAddress(GPUAddress addr) : SV_GroupIndex) { if(idx < argCount) { - for(uint i = 0; i < min(numExecutes, maxNumExecutes); i++) + for(uint i = 0; i < min(numExecutes[0], maxNumExecutes); i++) { uint offs = argStride * i + argOffsets[idx / 4][idx % 4]; diff --git a/renderdoc/driver/d3d12/d3d12_debug.cpp b/renderdoc/driver/d3d12/d3d12_debug.cpp index 80a978cf0..fa56121e4 100644 --- a/renderdoc/driver/d3d12/d3d12_debug.cpp +++ b/renderdoc/driver/d3d12/d3d12_debug.cpp @@ -1314,9 +1314,9 @@ rdcpair D3D12DebugManager::PatchExecuteIndirect( cmd->SetComputeRootSignature(m_EIPatchRootSig); cmd->SetComputeRootConstantBufferView(0, UploadConstants(argOffsets.data(), argOffsets.byteSize())); if(countBufAddr == 0) - cmd->SetComputeRootConstantBufferView(1, UploadConstants(&maxCount, sizeof(uint32_t))); + cmd->SetComputeRootShaderResourceView(1, UploadConstants(&maxCount, sizeof(uint32_t))); else - cmd->SetComputeRootConstantBufferView(1, countBufAddr); + cmd->SetComputeRootShaderResourceView(1, countBufAddr); cmd->SetComputeRoot32BitConstant(2, maxCount, 0); cmd->SetComputeRootShaderResourceView(3, m_EIPatchBufferData->GetGPUVirtualAddress()); cmd->SetComputeRootUnorderedAccessView(4, ret.first->GetGPUVirtualAddress() + ret.second); @@ -2023,7 +2023,7 @@ void D3D12DebugManager::PrepareExecuteIndirectPatching(GPUAddressRangeTracker &o bytebuf root = EncodeRootSig(m_pDevice->RootSigVersion(), { cbvParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0), - cbvParam(D3D12_SHADER_VISIBILITY_ALL, 0, 1), + srvParam(D3D12_SHADER_VISIBILITY_ALL, 0, 1), constParam(D3D12_SHADER_VISIBILITY_ALL, 0, 2, 1), srvParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0), uavParam(D3D12_SHADER_VISIBILITY_ALL, 0, 0),