* Create the command allocator for each frame. */
| 759 | * Create the command allocator for each frame. |
| 760 | */ |
| 761 | void 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. |