Flutter Engine
The Flutter Engine
ComputeTask.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef skgpu_graphite_task_ComputeTask_DEFINED
9#define skgpu_graphite_task_ComputeTask_DEFINED
10
14
15#include <memory>
16
17namespace skgpu::graphite {
18
19class DispatchGroup;
20
21/**
22 * ComputeTask handles preparing and recording DispatchGroups into a series of compute dispatches
23 * within a command buffer. It is guaranteed that dispatches within a DispatchGroup will be executed
24 * sequentially.
25 */
26class ComputeTask final : public Task {
27public:
29
30 static sk_sp<ComputeTask> Make(DispatchGroupList dispatchGroups);
31
32 ~ComputeTask() override;
33
36 const RuntimeEffectDictionary*) override;
38
39private:
40 explicit ComputeTask(DispatchGroupList dispatchGroups);
41
42 DispatchGroupList fDispatchGroups;
43
44 // Every element of this list is a task that must execute before the DispatchGroup stored at the
45 // same array index. Child tasks are allowed to be a nullptr to represent NOP (i.e. the
46 // corresponding DispatchGroup doesn't have any pre-tasks).
48};
49
50} // namespace skgpu::graphite
51
52#endif // skgpu_graphite_task_ComputeTask_DEFINED
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Definition: ComputeTask.cpp:52
Status prepareResources(ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *) override
Definition: ComputeTask.cpp:30
static sk_sp< ComputeTask > Make(DispatchGroupList dispatchGroups)
Definition: ComputeTask.cpp:17