Fix GPU Tasks queue to be executed on frame start, rather than end
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user