Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
skgpu::graphite::WorkgroupSize Struct Reference

#include <ComputeTypes.h>

Public Member Functions

 WorkgroupSize ()=default
 
 WorkgroupSize (uint32_t width, uint32_t height, uint32_t depth)
 
uint32_t scalarSize () const
 

Public Attributes

uint32_t fWidth = 1
 
uint32_t fHeight = 1
 
uint32_t fDepth = 1
 

Detailed Description

Defines the space that a compute shader operates on. A problem space is logically divided into abstract "work groups" (or "thread groups" in Metal/D3D12).

The "work group count" or "global size" of the work group is a 3-dimensional number that defines the size of the problem space. The user must provide the global size to define the number of work groups that execute as part of a dispatch.

The local size of a work group defines the number of parallel execution units that run in that group. The local group size is defined in terms of the "raw number of threads" that run within the group.

A local group is further divided into fixed-sized SIMD units called "subgroups" (in Vulkan terminology - these are referred to as "SIMD groups"/"threads" in Metal, "wavefronts" in OpenCL, "warps" in CUDA).

The local size is defined in 3 dimensions and must be determined based on hardware limitations, which can be queried via Caps::maxComputeWorkgroupSize() (for each individual dimension) and Caps::maxComputeInvocationsPerWorkgroup().

The WorkgroupSize type is used to represent both global size and local size.

Definition at line 48 of file ComputeTypes.h.

Constructor & Destructor Documentation

◆ WorkgroupSize() [1/2]

skgpu::graphite::WorkgroupSize::WorkgroupSize ( )
default

◆ WorkgroupSize() [2/2]

skgpu::graphite::WorkgroupSize::WorkgroupSize ( uint32_t  width,
uint32_t  height,
uint32_t  depth 
)
inline

Definition at line 50 of file ComputeTypes.h.

Member Function Documentation

◆ scalarSize()

uint32_t skgpu::graphite::WorkgroupSize::scalarSize ( ) const
inline

Definition at line 55 of file ComputeTypes.h.

55{ return fWidth * fHeight * fDepth; }

Member Data Documentation

◆ fDepth

uint32_t skgpu::graphite::WorkgroupSize::fDepth = 1

Definition at line 59 of file ComputeTypes.h.

◆ fHeight

uint32_t skgpu::graphite::WorkgroupSize::fHeight = 1

Definition at line 58 of file ComputeTypes.h.

◆ fWidth

uint32_t skgpu::graphite::WorkgroupSize::fWidth = 1

Definition at line 57 of file ComputeTypes.h.


The documentation for this struct was generated from the following file: