From f0bcc7056351188873aef77b67b88f68e082eec2 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 22 Apr 2025 23:44:34 +0200 Subject: [PATCH] Attempt to fix game cooking regression from ef188d06c4a3572eee72a1cdd2032b8c7438e149 --- Source/Engine/Graphics/Async/GPUTasksContext.cpp | 2 +- Source/Engine/Graphics/Async/GPUTasksContext.h | 2 +- Source/Engine/Graphics/Async/GPUTasksManager.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Graphics/Async/GPUTasksContext.cpp b/Source/Engine/Graphics/Async/GPUTasksContext.cpp index 4ef85c68a..fe2198865 100644 --- a/Source/Engine/Graphics/Async/GPUTasksContext.cpp +++ b/Source/Engine/Graphics/Async/GPUTasksContext.cpp @@ -51,7 +51,7 @@ void GPUTasksContext::Run(GPUTask* task) ASSERT(task != nullptr); task->Execute(this); - if (task->GetSyncStart() != 0) + //if (task->GetSyncStart() != 0) _tasksSyncing.Add(task); } diff --git a/Source/Engine/Graphics/Async/GPUTasksContext.h b/Source/Engine/Graphics/Async/GPUTasksContext.h index 9afb9b575..57c4673e7 100644 --- a/Source/Engine/Graphics/Async/GPUTasksContext.h +++ b/Source/Engine/Graphics/Async/GPUTasksContext.h @@ -18,7 +18,7 @@ protected: CriticalSection _locker; GPUSyncPoint _currentSyncPoint; int32 _totalTasksDoneCount = 0; - Array> _tasksSyncing; + Array _tasksSyncing; public: /// diff --git a/Source/Engine/Graphics/Async/GPUTasksManager.cpp b/Source/Engine/Graphics/Async/GPUTasksManager.cpp index 3c41f9da8..d7c9b6f76 100644 --- a/Source/Engine/Graphics/Async/GPUTasksManager.cpp +++ b/Source/Engine/Graphics/Async/GPUTasksManager.cpp @@ -51,11 +51,12 @@ void GPUTask::Enqueue() void GPUTask::OnCancel() { // Check if task is waiting for sync (very likely situation) - if (IsSyncing() && _context) + if (IsSyncing()) { // Task has been performed but is waiting for a CPU/GPU sync so we have to cancel that _context->OnCancelSync(this); _context = nullptr; + SetState(TaskState::Canceled); } // Base