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

Function CreateCommandAllocator

Chapter_14/src/Graphics.cpp:761–772  ·  view source on GitHub ↗

* Create the command allocator for each frame. */

Source from the content-addressed store, hash-verified

759* Create the command allocator for each frame.
760*/
761void CreateCommandAllocator(D3D12Global &d3d)
762{
763 for (UINT n = 0; n < 2; n++)
764 {
765 HRESULT hr = d3d.device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&d3d.cmdAlloc[n]));
766 Utils::Validate(hr, L"Error: failed to create the command allocator!");
767
768#if NAME_D3D_RESOURCES
769 d3d.cmdAlloc[n]->SetName((L"D3D12 Command Allocator " + std::to_wstring(n)).c_str());
770#endif
771 }
772}
773
774/**
775* Create the command list.

Callers 1

InitMethod · 0.85

Calls 2

ValidateFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected