From f62777459b6c2499f533b61f4cbd4744bc907688 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 28 Apr 2017 17:28:07 +0100 Subject: [PATCH] Fix index used for constant buffer slots in D3D11 pipeline viewer --- .../Windows/PipelineState/D3D11PipelineStateViewer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index fcd04bde7..7daa0c2cc 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -947,13 +947,18 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL const ConstantBlock *shaderCBuf = NULL; + int cbufIdx = -1; + if(shaderDetails) { - for(const ConstantBlock &bind : shaderDetails->ConstantBlocks) + for(int cb = 0; cb < shaderDetails->ConstantBlocks.count; cb++) { + const ConstantBlock &bind = shaderDetails->ConstantBlocks[cb]; + if(bind.bindPoint == i) { shaderCBuf = &bind; + cbufIdx = cb; break; } } @@ -1002,7 +1007,7 @@ void D3D11PipelineStateViewer::setShaderState(const D3D11Pipe::Shader &stage, QL RDTreeWidgetItem *node = new RDTreeWidgetItem({slotname, name, vecrange, sizestr, ""}); - node->setTag(QVariant::fromValue(i)); + node->setTag(QVariant::fromValue(cbufIdx)); if(!filledSlot) setEmptyRow(node);