Fix display of RTVs and DSVs in D3D12 pipeline state viewer

This commit is contained in:
baldurk
2018-04-13 16:43:44 +01:00
parent 93866387a7
commit e51a14f18a
@@ -679,7 +679,7 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view,
bool viewDetails = false;
if(view.space == D3D12ViewTag::OMDepth)
if(view.type == D3D12ViewTag::OMDepth)
viewDetails = m_Ctx.CurD3D12PipelineState().outputMerger.depthReadOnly ||
m_Ctx.CurD3D12PipelineState().outputMerger.stencilReadOnly;
@@ -691,8 +691,7 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view,
// if a target is set to RTVs or DSV, it is implicitly used
if(filledSlot)
usedSlot =
usedSlot || view.space == D3D12ViewTag::OMTarget || view.space == D3D12ViewTag::OMDepth;
usedSlot = usedSlot || view.type == D3D12ViewTag::OMTarget || view.type == D3D12ViewTag::OMDepth;
if(showNode(usedSlot, filledSlot))
{
@@ -701,7 +700,7 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view,
if(shaderInput && !shaderInput->name.empty())
regname += lit(": ") + shaderInput->name;
if(view.space == D3D12ViewTag::OMDepth)
if(view.type == D3D12ViewTag::OMDepth)
regname = tr("Depth");
uint32_t w = 1, h = 1, d = 1;
@@ -781,8 +780,16 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view,
viewDetails = true;
}
RDTreeWidgetItem *node = new RDTreeWidgetItem(
{rootel, view.space, regname, r.resourceId, typeName, w, h, d, a, format, QString()});
RDTreeWidgetItem *node = NULL;
if(view.type == D3D12ViewTag::OMTarget)
node = new RDTreeWidgetItem({view.reg, r.resourceId, typeName, w, h, d, a, format, QString()});
else if(view.type == D3D12ViewTag::OMDepth)
node =
new RDTreeWidgetItem({tr("Depth"), r.resourceId, typeName, w, h, d, a, format, QString()});
else
node = new RDTreeWidgetItem(
{rootel, view.space, regname, r.resourceId, typeName, w, h, d, a, format, QString()});
node->setTag(QVariant::fromValue(view));