Shader Explorer
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.

compute.wgsl

Bindings

source_buffer

#
@group(0)
@binding(0)
var<storage, read> source_buffer: array<InstanceData>

instance_buffer

#
@group(0)
@binding(1)
var<storage, read_write> instance_buffer: array<InstanceData>

indirect_args

#
@group(0)
@binding(2)
var<storage, read_write> indirect_args: DrawIndexedIndirectArgs

camera

#
@group(0)
@binding(3)
var<uniform> camera: CameraCullData

lod_data

#
@group(0)
@binding(4)
var<uniform> lod_data: LodCullData

Structures

InstanceData

#
struct InstanceData {
pos_and_scale: vec4<f32> ,
index: u32 ,
pad1: u32 ,
pad2: u32 ,
pad3: u32 ,
}

DrawIndexedIndirectArgs

#
struct DrawIndexedIndirectArgs {
index_count: u32 ,
instance_count: atomic<u32> ,
first_index: u32 ,
base_vertex: i32 ,
first_instance: u32 ,
}

CameraCullData

#
struct CameraCullData {
view_pos: vec4<f32> ,
}

LodCullData

#
struct LodCullData {
visibility_range: vec4<f32> ,
world_from_local: mat4x4<f32> ,
}

Functions

hash_noise

#
fn hash_noise (
index: u32
) -> f32

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_id: vec3<u32>
)