Skip to content

Commit

Permalink
Handle D3D12 CreateConstantBufferView with a NULL desc
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Jul 28, 2021
1 parent a516c2d commit a490606
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions renderdoc/driver/d3d12/d3d12_device_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,9 @@ void WrappedID3D12Device::CreateConstantBufferView(const D3D12_CONSTANT_BUFFER_V
m_FrameCaptureRecord->AddChunk(scope.Get());
}

GetResourceManager()->MarkResourceFrameReferenced(
WrappedID3D12Resource::GetResIDFromAddr(pDesc->BufferLocation), eFrameRef_Read);
if(pDesc)
GetResourceManager()->MarkResourceFrameReferenced(
WrappedID3D12Resource::GetResIDFromAddr(pDesc->BufferLocation), eFrameRef_Read);
}

GetWrapped(DestDescriptor)->Init(pDesc);
Expand Down
2 changes: 2 additions & 0 deletions util/test/demos/d3d12/d3d12_parameter_zoo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ float4 main() : SV_Target0

uint32_t indices[1024 / 4] = {0, 1, 2};

dev->CreateConstantBufferView(NULL, m_CBVUAVSRV->GetCPUDescriptorHandleForHeapStart());

ID3D12ResourcePtr vb = MakeBuffer().Data(DefaultTri);
ID3D12ResourcePtr ib = MakeBuffer().Data(indices);

Expand Down

0 comments on commit a490606

Please sign in to comment.