diff options
| author | skallweitNV <64953474+skallweitNV@users.noreply.github.com> | 2023-06-29 22:12:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-29 13:12:27 -0700 |
| commit | 7f0c27a5ac40c1658daa05affd585c3dd0bbf415 (patch) | |
| tree | 55d6befeb8fe79b3388a29bce0f0b5809a3b9525 | |
| parent | dccc9091c8f8f0911c79f7f6662c70c627249997 (diff) | |
Fix handling result codes in D3D12 resource creation calls (#2949)
Co-authored-by: Yong He <yonghe@outlook.com>
| -rw-r--r-- | tools/gfx/d3d12/d3d12-swap-chain.cpp | 2 | ||||
| -rw-r--r-- | tools/gfx/d3d12/d3d12-transient-heap.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/gfx/d3d12/d3d12-swap-chain.cpp b/tools/gfx/d3d12/d3d12-swap-chain.cpp index 57825a323..8d4e723ea 100644 --- a/tools/gfx/d3d12/d3d12-swap-chain.cpp +++ b/tools/gfx/d3d12/d3d12-swap-chain.cpp @@ -19,7 +19,7 @@ Result SwapchainImpl::init( m_dxgiFactory = renderer->m_deviceInfo.m_dxgiFactory; SLANG_RETURN_ON_FAIL( D3DSwapchainBase::init(swapchainDesc, window, DXGI_SWAP_EFFECT_FLIP_DISCARD)); - renderer->m_device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(m_fence.writeRef())); + SLANG_RETURN_ON_FAIL(renderer->m_device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(m_fence.writeRef()))); SLANG_RETURN_ON_FAIL(m_swapChain->QueryInterface(m_swapChain3.writeRef())); for (GfxIndex i = 0; i < swapchainDesc.imageCount; i++) diff --git a/tools/gfx/d3d12/d3d12-transient-heap.cpp b/tools/gfx/d3d12/d3d12-transient-heap.cpp index 9139f6d8a..60f40cc66 100644 --- a/tools/gfx/d3d12/d3d12-transient-heap.cpp +++ b/tools/gfx/d3d12/d3d12-transient-heap.cpp @@ -202,12 +202,12 @@ Result TransientResourceHeapImpl::createCommandBuffer(ICommandBuffer** outCmdBuf return SLANG_OK; } ComPtr<ID3D12GraphicsCommandList> cmdList; - m_device->m_device->CreateCommandList( + SLANG_RETURN_ON_FAIL(m_device->m_device->CreateCommandList( 0, D3D12_COMMAND_LIST_TYPE_DIRECT, m_commandAllocator, nullptr, - IID_PPV_ARGS(cmdList.writeRef())); + IID_PPV_ARGS(cmdList.writeRef()))); m_d3dCommandListPool.add(cmdList); RefPtr<CommandBufferImpl> cmdBuffer = new CommandBufferImpl(); |
