Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
graphite
ComputeTypes.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_ComputeTypes_DEFINED
9
#define skgpu_graphite_ComputeTypes_DEFINED
10
11
#include "
src/gpu/graphite/ResourceTypes.h
"
12
13
namespace
skgpu::graphite
{
14
15
// The maximum number of shared resource binding slots permitted for ComputeSteps of a DispatchGroup
16
constexpr
int
kMaxComputeDataFlowSlots
= 28;
17
18
// The minimum element stride of an indirect dispatch argument array in bytes
19
struct
IndirectDispatchArgs
{
20
uint32_t
global_size_x
;
21
uint32_t
global_size_y
;
22
uint32_t
global_size_z
;
23
};
24
constexpr
size_t
kIndirectDispatchArgumentSize
=
sizeof
(
IndirectDispatchArgs
);
25
26
/**
27
* Defines the space that a compute shader operates on. A problem space is logically divided into
28
* abstract "work groups" (or "thread groups" in Metal/D3D12).
29
*
30
* The "work group count" or "global size" of the work group is a 3-dimensional number that defines
31
* the size of the problem space. The user must provide the global size to define the number of
32
* work groups that execute as part of a dispatch.
33
*
34
* The local size of a work group defines the number of parallel execution units that run in that
35
* group. The local group size is defined in terms of the "raw number of threads" that run within
36
* the group.
37
*
38
* A local group is further divided into fixed-sized SIMD units called "subgroups" (in Vulkan
39
* terminology - these are referred to as "SIMD groups"/"threads" in Metal, "wavefronts" in OpenCL,
40
* "warps" in CUDA).
41
*
42
* The local size is defined in 3 dimensions and must be determined based on hardware limitations,
43
* which can be queried via Caps::maxComputeWorkgroupSize() (for each individual dimension) and
44
* Caps::maxComputeInvocationsPerWorkgroup().
45
*
46
* The WorkgroupSize type is used to represent both global size and local size.
47
*/
48
struct
WorkgroupSize
{
49
WorkgroupSize
() =
default
;
50
WorkgroupSize
(uint32_t
width
, uint32_t
height
, uint32_t depth)
51
:
fWidth
(
width
)
52
,
fHeight
(
height
)
53
,
fDepth
(depth) {}
54
55
uint32_t
scalarSize
()
const
{
return
fWidth
*
fHeight
*
fDepth
; }
56
57
uint32_t
fWidth
= 1;
58
uint32_t
fHeight
= 1;
59
uint32_t
fDepth
= 1;
60
};
61
62
}
// namespace skgpu::graphite
63
64
#endif
// skgpu_graphite_ComputeTypes_DEFINED
ResourceTypes.h
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
skgpu::graphite::kIndirectDispatchArgumentSize
constexpr size_t kIndirectDispatchArgumentSize
Definition:
ComputeTypes.h:24
skgpu::graphite::kMaxComputeDataFlowSlots
constexpr int kMaxComputeDataFlowSlots
Definition:
ComputeTypes.h:16
height
int32_t height
Definition:
serialization_callbacks.cc:1
width
int32_t width
Definition:
serialization_callbacks.cc:0
skgpu::graphite::IndirectDispatchArgs
Definition:
ComputeTypes.h:19
skgpu::graphite::IndirectDispatchArgs::global_size_x
uint32_t global_size_x
Definition:
ComputeTypes.h:20
skgpu::graphite::IndirectDispatchArgs::global_size_z
uint32_t global_size_z
Definition:
ComputeTypes.h:22
skgpu::graphite::IndirectDispatchArgs::global_size_y
uint32_t global_size_y
Definition:
ComputeTypes.h:21
skgpu::graphite::WorkgroupSize
Definition:
ComputeTypes.h:48
skgpu::graphite::WorkgroupSize::scalarSize
uint32_t scalarSize() const
Definition:
ComputeTypes.h:55
skgpu::graphite::WorkgroupSize::fWidth
uint32_t fWidth
Definition:
ComputeTypes.h:57
skgpu::graphite::WorkgroupSize::WorkgroupSize
WorkgroupSize()=default
skgpu::graphite::WorkgroupSize::fHeight
uint32_t fHeight
Definition:
ComputeTypes.h:58
skgpu::graphite::WorkgroupSize::fDepth
uint32_t fDepth
Definition:
ComputeTypes.h:59
skgpu::graphite::WorkgroupSize::WorkgroupSize
WorkgroupSize(uint32_t width, uint32_t height, uint32_t depth)
Definition:
ComputeTypes.h:50
Generated on Sun Jun 23 2024 21:56:25 for Flutter Engine by
1.9.4