Sync any pending data uploads before any queue executes on D3D12

This commit is contained in:
baldurk
2023-09-27 14:47:54 +01:00
parent 5addf044d7
commit adfcedff81
3 changed files with 13 additions and 0 deletions
@@ -465,6 +465,8 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se
{
ID3D12CommandQueue *real = Unwrap(pQueue);
m_pDevice->DataUploadSync();
if(m_PrevQueueId != GetResID(pQueue))
{
RDCDEBUG("Previous queue execution was on queue %s, now executing %s, syncing GPU",
+9
View File
@@ -3926,6 +3926,15 @@ void WrappedID3D12Device::DestroyInternalResources()
CloseHandle(m_GPUSyncHandle);
}
void WrappedID3D12Device::DataUploadSync()
{
if(m_CurDataUpload >= 0)
{
GPUSync();
m_CurDataUpload = 0;
}
}
void WrappedID3D12Device::GPUSync(ID3D12CommandQueue *queue, ID3D12Fence *fence)
{
m_GPUSyncCounter++;
+2
View File
@@ -972,6 +972,8 @@ public:
void ExecuteLists(WrappedID3D12CommandQueue *queue = NULL, bool InFrameCaptureBoundary = false);
void FlushLists(bool forceSync = false, ID3D12CommandQueue *queue = NULL);
void DataUploadSync();
void GPUSync(ID3D12CommandQueue *queue = NULL, ID3D12Fence *fence = NULL);
void GPUSyncAllQueues();