MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Execute

Method Execute

Source/Engine/Graphics/Async/GPUTasksManager.cpp:10–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "Engine/Graphics/GPUDevice.h"
9
10void GPUTask::Execute(GPUTasksContext* context)
11{
12 ASSERT(IsQueued() && _context == nullptr);
13 SetState(TaskState::Running);
14
15 // Perform an operation
16 const auto result = run(context);
17
18 // Process result
19 if (IsCancelRequested())
20 {
21 SetState(TaskState::Canceled);
22 }
23 else if (result != Result::Ok)
24 {
25 LOG(Warning, "\'{0}\' failed with result: {1}", ToString(), ToString(result));
26 OnFail();
27 }
28 else
29 {
30 // Save task completion point (for synchronization)
31 _syncPoint = context->GetCurrentSyncPoint();
32 _context = context;
33 if (_syncLatency == 0)
34 {
35 // No delay on sync
36 Sync();
37 }
38 }
39}
40
41String GPUTask::ToString() const
42{

Callers 2

EndMethod · 0.45
RunMethod · 0.45

Calls 5

IsQueuedFunction · 0.85
SetStateFunction · 0.85
IsCancelRequestedFunction · 0.85
GetCurrentSyncPointMethod · 0.80
ToStringFunction · 0.50

Tested by

no test coverage detected