Fix shader debugging and pipeline viewer with constant buffer arrays

With SM5.1 and D3D12, constant buffer arrays can be declared which
are treated as an array of resources on the shader side, and a simple
collection of descriptors on the D3D12 side. DXBCDebug::GlobalState
handles the bridge between these by storing each array resource as a
nested ShaderVariable struct. Accessing the data for instructions
traverses the structure similarly. The shader viewer handles nested
resources and displays them in the appropriate tree view. In the
pipeline viewer, descriptors for CB arrays now indicate the array
index and correctly handle buffer offsets for viewing.
This commit is contained in:
Steve Karolewics
2020-02-07 09:24:19 -08:00
committed by Baldur Karlsson
parent 392d362ee8
commit 671add4035
8 changed files with 131 additions and 26 deletions
@@ -144,8 +144,11 @@ void ConstantBufferPreviewer::OnEventChanged(uint32_t eventId)
setVariables(vars);
if(wasEmpty)
{
// Expand before resizing so that collapsed data will already be visible when expanded
ui->variables->expandAll();
for(int i = 0; i < 3; i++)
ui->variables->resizeColumnToContents(i);
ui->variables->collapseAll();
}
ui->variables->applyExpansion(state, 0);
});
@@ -169,8 +172,11 @@ void ConstantBufferPreviewer::OnEventChanged(uint32_t eventId)
setVariables(vars);
if(wasEmpty)
{
// Expand before resizing so that collapsed data will already be visible when expanded
ui->variables->expandAll();
for(int i = 0; i < 3; i++)
ui->variables->resizeColumnToContents(i);
ui->variables->collapseAll();
}
// if we have saved expansion state for the new shader, apply it, otherwise apply the