| 1420 | } |
| 1421 | |
| 1422 | void 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 ¶m : 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; |
no test coverage detected