Fix crash in D3D12 when constant buffer was binded but not updated before the draw
This commit is contained in:
@@ -459,8 +459,10 @@ void GPUContextDX12::flushCBs()
|
|||||||
const auto cb = _cbHandles[i];
|
const auto cb = _cbHandles[i];
|
||||||
if (cb)
|
if (cb)
|
||||||
{
|
{
|
||||||
ASSERT(cb->GPUAddress != 0);
|
if (cb->GPUAddress != 0)
|
||||||
_commandList->SetGraphicsRootConstantBufferView(DX12_ROOT_SIGNATURE_CB + i, cb->GPUAddress);
|
_commandList->SetGraphicsRootConstantBufferView(DX12_ROOT_SIGNATURE_CB + i, cb->GPUAddress);
|
||||||
|
else
|
||||||
|
_cbGraphicsDirtyFlag = true; // CB was binded but not yet assigned so stay in dirty state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -472,8 +474,10 @@ void GPUContextDX12::flushCBs()
|
|||||||
const auto cb = _cbHandles[i];
|
const auto cb = _cbHandles[i];
|
||||||
if (cb)
|
if (cb)
|
||||||
{
|
{
|
||||||
ASSERT(cb->GPUAddress != 0);
|
if (cb->GPUAddress != 0)
|
||||||
_commandList->SetComputeRootConstantBufferView(DX12_ROOT_SIGNATURE_CB + i, cb->GPUAddress);
|
_commandList->SetComputeRootConstantBufferView(DX12_ROOT_SIGNATURE_CB + i, cb->GPUAddress);
|
||||||
|
else
|
||||||
|
_cbComputeDirtyFlag = true; // CB was binded but not yet assigned so stay in dirty state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user