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.

unpack_bins.wgsl

Bindings

bin_unpacking_metadata

#
@group(0)
@binding(0)
var<uniform> bin_unpacking_metadata: BinUnpackingMetadata

binned_mesh_instances

#
@group(0)
@binding(1)
var<storage> binned_mesh_instances: array<BinnedMeshInstance>

preprocess_work_items

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

bin_index_to_indirect_parameters_offset

#
@group(0)
@binding(3)
var<storage> bin_index_to_indirect_parameters_offset: array<u32>

Structures

BinUnpackingMetadata

#

Information needed to unpack bins belonging to a single batch set.

struct BinUnpackingMetadata {
base_output_work_item_index: u32 ,
base_indirect_parameters_index: u32 ,
binned_mesh_instance_count: u32 ,
pad_a: u32 ,
}

BinnedMeshInstance

#

Note that this structure isn’t sorted within the binned_mesh_instances buffer. Instances from the same bin aren’t guaranteed to be adjacent to one another.

struct BinnedMeshInstance {
input_uniform_index: u32 ,
bin_index: u32 ,
}

Functions

main

#
@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
fn main (
@builtin(global_invocation_id)
global_invocation_id: vec3<u32>
)