Revert d3c49be80f and do it better
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user