Fix GPU Tasks queue to be executed on frame start, rather than end

This commit is contained in:
Wojtek Figat
2024-04-25 17:10:39 +02:00
parent 10c47b8c2a
commit 97078cda7e
5 changed files with 24 additions and 22 deletions

View File

@@ -23,19 +23,18 @@ void DefaultGPUTasksExecutor::FrameBegin()
_context = createContext();
_context->OnFrameBegin();
}
void DefaultGPUTasksExecutor::FrameEnd()
{
ASSERT(_context != nullptr);
// Default implementation performs async operations on end of the frame which is synchronized with a rendering thread
// Default implementation performs async operations on start of the frame which is synchronized with a rendering thread
GPUTask* buffer[32];
const int32 count = GPUDevice::Instance->GetTasksManager()->RequestWork(buffer, 32);
for (int32 i = 0; i < count; i++)
{
_context->Run(buffer[i]);
}
}
void DefaultGPUTasksExecutor::FrameEnd()
{
ASSERT(_context != nullptr);
_context->OnFrameEnd();
}