Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

vfx_utils.wgsl

Bindings

args

#
@group(0)
@binding(0)
var<uniform> args: BufferOperationArgs

src_buffer

#
@group(0)
@binding(1)
var<storage, read> src_buffer: array<u32>

dst_buffer

#
@group(0)
@binding(2)
var<storage, read_write> dst_buffer: array<u32>

Structures

BufferOperationArgs

#

Arguments for a block operation on a buffer.

struct BufferOperationArgs {
src_offset: u32 ,
src_stride: u32 ,
dst_offset: u32 ,
dst_stride: u32 ,
count: u32 ,
}

Functions

zero_buffer

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(64)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1

Clear a buffer to zero. Each thread clears a single u32.

fn zero_buffer (
@builtin(global_invocation_id)
global_invocation_id: vec3<u32>
)

copy_buffer

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(64)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1

Copy a source buffer into a destination buffer. Each thread copies a single u32.

fn copy_buffer (
@builtin(global_invocation_id)
global_invocation_id: vec3<u32>
)

calc_workground_count

#

Calculate the number of workgroups to dispatch for a given number of threads.

fn calc_workground_count (
thread_count: u32
) -> u32

fill_dispatch_args

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(64)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1

Fill indirect dispatch arguments from a raw element count, by copying the element count and rounding it up to the number of thread per workgroup. Each thread copies a single u32.

fn fill_dispatch_args (
@builtin(global_invocation_id)
global_invocation_id: vec3<u32>
)

fill_dispatch_args_self

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(64)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1

Fill indirect dispatch arguments from a raw element count, by copying the element count and rounding it up to the number of thread per workgroup. Each thread copies a single single u32. Same as fill_dispatch_args(), but both read and write are from the destination buffer. The source buffer is ignored (no binding).

fn fill_dispatch_args_self (
@builtin(global_invocation_id)
global_invocation_id: vec3<u32>
)