Fix display of typed buffers in D3D pipeline state viewer

This commit is contained in:
baldurk
2021-07-23 16:24:16 +01:00
parent d2a03c6e06
commit d0acc2a349
2 changed files with 3 additions and 3 deletions
@@ -771,7 +771,7 @@ void D3D11PipelineStateViewer::addResourceRow(const D3D11ViewTag &view,
d = 0;
a = 0;
format = QString();
typeName = lit("Buffer");
typeName = QFormatStr("%1Buffer").arg(view.type == D3D11ViewTag::UAV ? lit("RW") : QString());
if(r.bufferFlags & D3DBufferViewFlags::Raw)
{
@@ -802,13 +802,13 @@ void D3D12PipelineStateViewer::addResourceRow(const D3D12ViewTag &view, const Bi
d = 0;
a = 0;
format = QString();
typeName = lit("Buffer");
typeName = QFormatStr("%1Buffer").arg(uav ? lit("RW") : QString());
if(r.bufferFlags & D3DBufferViewFlags::Raw)
{
typeName = QFormatStr("%1ByteAddressBuffer").arg(uav ? lit("RW") : QString());
}
else if(r.elementByteSize > 0)
else if(r.elementByteSize > 0 && r.viewFormat.type == ResourceFormatType::Undefined)
{
// for structured buffers, display how many 'elements' there are in the buffer
a = buf->length / r.elementByteSize;