MCPcopy Create free account
hub / github.com/Apress/Ray-Tracing-Gems-II / CreateDescriptorHeaps

Function CreateDescriptorHeaps

Chapter_14/src/Graphics.cpp:400–416  ·  view source on GitHub ↗

* Create the RTV descriptor heap. */

Source from the content-addressed store, hash-verified

398* Create the RTV descriptor heap.
399*/
400void CreateDescriptorHeaps(D3D12Global &d3d, D3D12Resources &resources)
401{
402 // Describe the RTV descriptor heap
403 D3D12_DESCRIPTOR_HEAP_DESC rtvDesc = {};
404 rtvDesc.NumDescriptors = 2;
405 rtvDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
406 rtvDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
407
408 // Create the RTV heap
409 HRESULT hr = d3d.device->CreateDescriptorHeap(&rtvDesc, IID_PPV_ARGS(&resources.rtvHeap));
410 Utils::Validate(hr, L"Error: failed to create RTV descriptor heap!");
411#if NAME_D3D_RESOURCES
412 resources.rtvHeap->SetName(L"RTV Descriptor Heap");
413#endif
414
415 resources.rtvDescSize = d3d.device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
416}
417
418/**
419* Update the constant buffer with raytracing data.

Callers 2

InitMethod · 0.85

Calls 1

ValidateFunction · 0.85

Tested by

no test coverage detected