Revert d3c49be80f and do it better

This commit is contained in:
Wojtek Figat
2025-04-17 10:52:00 +02:00
parent 414b229b27
commit ef188d06c4
4 changed files with 27 additions and 44 deletions

View File

@@ -58,8 +58,6 @@ protected:
{
}
~GPUTask();
public:
/// <summary>
/// Gets a task type.
@@ -142,24 +140,5 @@ protected:
return true;
}
void OnCancel() override
{
// Check if task is waiting for sync (very likely situation)
if (IsSyncing())
{
// Task has been performed but is waiting for a CPU/GPU sync so we have to cancel that
ASSERT(_context != nullptr);
_context->OnCancelSync(this);
_context = nullptr;
SetState(TaskState::Canceled);
}
else
{
// Maybe we could also handle cancel event during running but not yet syncing
ASSERT(!IsRunning());
}
// Base
Task::OnCancel();
}
void OnCancel() override;
};