mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 00:16:45 +00:00
Prevent crash with OMSetRenderTargets in D3D12
This commit is contained in:
committed by
Baldur Karlsson
parent
c6a1a23adb
commit
9b43481234
@@ -1502,7 +1502,8 @@ void WrappedID3D12GraphicsCommandList::OMSetRenderTargets(
|
||||
m_ListRecord->AddChunk(scope.Get());
|
||||
if(RTsSingleHandleToDescriptorRange)
|
||||
{
|
||||
D3D12Descriptor *desc = GetWrapped(pRenderTargetDescriptors[0]);
|
||||
D3D12Descriptor *desc =
|
||||
(NumRenderTargetDescriptors == 0) ? NULL : GetWrapped(pRenderTargetDescriptors[0]);
|
||||
for(UINT i = 0; i < NumRenderTargetDescriptors; i++)
|
||||
{
|
||||
m_ListRecord->MarkResourceFrameReferenced(desc->GetHeapResourceId(), eFrameRef_Read);
|
||||
|
||||
@@ -123,6 +123,10 @@ void main(out float4 out1 : SV_Target0, out float4 out2 : SV_Target1)
|
||||
|
||||
Reset(cmd);
|
||||
|
||||
// Set null render targets to ensure that these work properly when attached
|
||||
cmd->OMSetRenderTargets(0, NULL, FALSE, NULL);
|
||||
cmd->OMSetRenderTargets(0, NULL, TRUE, NULL);
|
||||
|
||||
ID3D12ResourcePtr bb = StartUsingBackbuffer(cmd, D3D12_RESOURCE_STATE_RENDER_TARGET);
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE bbrtv =
|
||||
|
||||
Reference in New Issue
Block a user