Refactor: use CreateDesc for DescriptorHeap

This commit is contained in:
2026-03-17 01:22:11 +08:00
parent 9fda349fa1
commit 97653041bd

View File

@@ -319,15 +319,11 @@ bool InitD3D12(HWND inHWND, int inWidth, int inHeight) {
gDepthStencil.InitializeDepthStencil(device, inWidth, inHeight);
D3D12_DESCRIPTOR_HEAP_DESC d3dDescriptorHeapDescRTV = {};
d3dDescriptorHeapDescRTV.NumDescriptors = 2;
d3dDescriptorHeapDescRTV.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
D3D12_DESCRIPTOR_HEAP_DESC d3dDescriptorHeapDescRTV = XCEngine::RHI::D3D12DescriptorHeap::CreateDesc(XCEngine::RHI::DescriptorHeapType::RTV, 2);
gSwapChainRTVHeap.Initialize(device, XCEngine::RHI::DescriptorHeapType::RTV, 2);
gRTVDescriptorSize = gD3D12Device.GetDescriptorHandleIncrementSize(XCEngine::RHI::DescriptorHeapType::RTV);
D3D12_DESCRIPTOR_HEAP_DESC d3dDescriptorHeapDescDSV = {};
d3dDescriptorHeapDescDSV.NumDescriptors = 1;
d3dDescriptorHeapDescDSV.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV;
D3D12_DESCRIPTOR_HEAP_DESC d3dDescriptorHeapDescDSV = XCEngine::RHI::D3D12DescriptorHeap::CreateDesc(XCEngine::RHI::DescriptorHeapType::DSV, 1);
gSwapChainDSVHeap.Initialize(device, XCEngine::RHI::DescriptorHeapType::DSV, 1);
gDSVDescriptorSize = gD3D12Device.GetDescriptorHandleIncrementSize(XCEngine::RHI::DescriptorHeapType::DSV);