Add GetDescriptorHandleIncrementSize to D3D12Device and update main.cpp to use wrapper
This commit is contained in:
@@ -407,13 +407,13 @@ bool InitD3D12(HWND inHWND, int inWidth, int inHeight) {
|
||||
d3dDescriptorHeapDescRTV.NumDescriptors = 2;
|
||||
d3dDescriptorHeapDescRTV.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
|
||||
gSwapChainRTVHeap.Initialize(device, XCEngine::RHI::DescriptorHeapType::RTV, 2);
|
||||
gRTVDescriptorSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
|
||||
gRTVDescriptorSize = gDevice.GetDescriptorHandleIncrementSize(XCEngine::RHI::DescriptorHeapType::RTV);
|
||||
|
||||
D3D12_DESCRIPTOR_HEAP_DESC d3dDescriptorHeapDescDSV = {};
|
||||
d3dDescriptorHeapDescDSV.NumDescriptors = 1;
|
||||
d3dDescriptorHeapDescDSV.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV;
|
||||
gSwapChainDSVHeap.Initialize(device, XCEngine::RHI::DescriptorHeapType::DSV, 1);
|
||||
gDSVDescriptorSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
|
||||
gDSVDescriptorSize = gDevice.GetDescriptorHandleIncrementSize(XCEngine::RHI::DescriptorHeapType::DSV);
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE rtvHeapStart = gSwapChainRTVHeap.GetCPUDescriptorHandleForHeapStart();
|
||||
for (int i = 0; i < 2; i++) {
|
||||
@@ -667,7 +667,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE srvHeapPtr = srvHeap.GetCPUDescriptorHandleForHeapStart();
|
||||
gTextureSRV.InitializeAt(d3dDevice, texture, srvHeapPtr, &srvDesc);
|
||||
srvHeapPtr.ptr += d3dDevice->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
|
||||
srvHeapPtr.ptr += gDevice.GetDescriptorHandleIncrementSize(XCEngine::RHI::DescriptorHeapType::CBV_SRV_UAV);
|
||||
|
||||
EndCommandList();
|
||||
WaitForCompletionOfCommandList();
|
||||
|
||||
Reference in New Issue
Block a user