Add CreateDesc helper for DescriptorHeap

This commit is contained in:
2026-03-17 01:21:17 +08:00
parent f4db1eafea
commit 9fda349fa1
2 changed files with 11 additions and 0 deletions

View File

@@ -70,5 +70,14 @@ uint32_t D3D12DescriptorHeap::GetDescriptorCount() const {
return m_numDescriptors;
}
D3D12_DESCRIPTOR_HEAP_DESC D3D12DescriptorHeap::CreateDesc(DescriptorHeapType type, uint32_t numDescriptors, bool shaderVisible) {
D3D12_DESCRIPTOR_HEAP_DESC desc = {};
desc.Type = ToD3D12(type);
desc.NumDescriptors = numDescriptors;
desc.Flags = shaderVisible ? D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE : D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
desc.NodeMask = 0;
return desc;
}
} // namespace RHI
} // namespace XCEngine