Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
37private:
38 explicit ComputeTask(DispatchGroupList dispatchGroups);
39
40 DispatchGroupList fDispatchGroups;
41
42 // Every element of this list is a task that must execute before the DispatchGroup stored at the
43 // same array index. Child tasks are allowed to be a nullptr to represent NOP (i.e. the
44 // corresponding DispatchGroup doesn't have any pre-tasks).
46};
47
48} // namespace skgpu::graphite
49
50#endif // skgpu_graphite_task_ComputeTask_DEFINED
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
static sk_sp< ComputeTask > Make(DispatchGroupList dispatchGroups)
Status prepareResources(ResourceProvider *, const RuntimeEffectDictionary *) override