Don't crash in CreateUnorderedAccessView if a NULL descriptor is passed

This commit is contained in:
baldurk
2019-06-27 10:22:13 +01:00
parent 6487acdf0f
commit 24d55fde9f
+1 -1
View File
@@ -1028,7 +1028,7 @@ HRESULT WrappedID3D11Device::CreateUnorderedAccessView(ID3D11Resource *pResource
// if this UAV has a hidden counter, immediately mark it as dirty so we force initial
// contents to fetch its counter
if(pDesc->ViewDimension == D3D11_UAV_DIMENSION_BUFFER &&
if(pDesc && pDesc->ViewDimension == D3D11_UAV_DIMENSION_BUFFER &&
(pDesc->Buffer.Flags & (D3D11_BUFFER_UAV_FLAG_COUNTER | D3D11_BUFFER_UAV_FLAG_APPEND)) != 0)
{
GetResourceManager()->MarkDirtyResource(id);