MCPcopy Create free account
hub / github.com/baldurk/renderdoc / ViewD3D12State

Method ViewD3D12State

qrenderdoc/Windows/DescriptorViewer.cpp:1422–1508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420}
1421
1422void DescriptorViewer::ViewD3D12State()
1423{
1424 m_D3D12Heaps = m_Ctx.CurD3D12PipelineState()->descriptorHeaps;
1425 m_D3D12RootSig = m_Ctx.CurD3D12PipelineState()->rootSignature;
1426
1427 setWindowTitle(
1428 tr("%1 at EID %2").arg(m_Ctx.GetResourceName(m_D3D12RootSig.resourceId)).arg(m_Ctx.CurEvent()));
1429
1430 ui->pipeLabel->setText(
1431 tr("The pipeline state viewer shows the current bindings in an easier format.\n"
1432 "This is a snapshot of the root signature & bound parameters at EID %1.")
1433 .arg(m_Ctx.CurEvent()));
1434
1435 // fetch the descriptor contents for both heaps
1436
1437 m_Ctx.Replay().AsyncInvoke([this](IReplayController *r) {
1438 ResourceId resourceHeap, samplerHeap;
1439
1440 for(const D3D12Pipe::RootParam &param : m_D3D12RootSig.parameters)
1441 {
1442 for(const D3D12Pipe::RootTableRange &range : param.tableRanges)
1443 {
1444 if(range.category == DescriptorCategory::Sampler)
1445 {
1446 if(param.heap != ResourceId())
1447 samplerHeap = param.heap;
1448 }
1449 else
1450 {
1451 if(param.heap != ResourceId())
1452 resourceHeap = param.heap;
1453 }
1454
1455 if(resourceHeap != ResourceId() && samplerHeap != ResourceId())
1456 break;
1457 }
1458
1459 if(resourceHeap != ResourceId() && samplerHeap != ResourceId())
1460 break;
1461 }
1462
1463 rdcarray<DescriptorRange> ranges;
1464 ranges.resize(1);
1465
1466 rdcarray<Descriptor> descriptors;
1467 rdcarray<SamplerDescriptor> samplerDescriptors;
1468
1469 if(resourceHeap != ResourceId())
1470 {
1471 DescriptorStoreDescription *resourceDesc = m_Ctx.GetDescriptorStore(resourceHeap);
1472
1473 if(resourceDesc)
1474 {
1475 ranges[0].count = resourceDesc->descriptorCount;
1476 ranges[0].descriptorSize = resourceDesc->descriptorByteSize;
1477 ranges[0].offset = resourceDesc->firstDescriptorOffset;
1478 // we are interpreting typeless descriptors, assume D3D12 can interpret it
1479 ranges[0].type = DescriptorType::Unknown;

Callers 1

rootSigView_clickedMethod · 0.80

Calls 15

trFunction · 0.50
ResourceIdFunction · 0.50
moveFunction · 0.50
CurD3D12PipelineStateMethod · 0.45
argMethod · 0.45
GetResourceNameMethod · 0.45
CurEventMethod · 0.45
setTextMethod · 0.45
AsyncInvokeMethod · 0.45
resizeMethod · 0.45
GetDescriptorStoreMethod · 0.45
GetDescriptorsMethod · 0.45

Tested by

no test coverage detected