Skip to content

Commit

Permalink
If a constant buffer is unused, open raw buffer viewer. Closes #60
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Jun 30, 2014
1 parent 443ad1e commit 0fbdcbc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions renderdocui/Windows/PipelineState/D3D11PipelineStateViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1852,6 +1852,24 @@ private void shaderedit_Click(object sender, EventArgs e)

private void ShowCBuffer(D3D11PipelineState.ShaderStage stage, UInt32 slot)
{
if (stage.ShaderDetails != null &&
(stage.ShaderDetails.ConstantBlocks.Length <= slot ||
stage.ShaderDetails.ConstantBlocks[slot].name == "")
)
{
// unused cbuffer, open regular buffer viewer
var viewer = new BufferViewer(m_Core, false);

if (stage.ConstantBuffers.Length < slot)
return;

var buf = stage.ConstantBuffers[slot].Buffer;
viewer.ViewRawBuffer(buf);
viewer.Show(m_DockContent.DockPanel);

return;
}

var existing = ConstantBufferPreviewer.Has(stage.stage, slot);
if (existing != null)
{
Expand Down

0 comments on commit 0fbdcbc

Please sign in to comment.