Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Bindings

current_input

#
@group(0)
@binding(0)
var<storage> current_input: array<MeshInput>

previous_input

#
@group(0)
@binding(1)
var<storage> previous_input: array<MeshInput>

work_items

#
@group(0)
@binding(2)
var<storage> work_items: array<PreprocessWorkItem>

output

#
@group(0)
@binding(3)
var<storage, read_write> output: array<Mesh>

indirect_parameters

#
Active when
INDIRECT
@group(0)
@binding(4)
var<storage, read_write> indirect_parameters: array<IndirectParameters>

mesh_culling_data

#
Active when
FRUSTUM_CULLING
@group(0)
@binding(5)
var<storage> mesh_culling_data: array<MeshCullingData>

view

#
Active when
FRUSTUM_CULLING
@group(0)
@binding(6)
var<uniform> view: View

Structures

MeshInput

#

Per-frame data that the CPU supplies to the GPU.

struct MeshInput {
world_from_local: mat3x4<f32>,
lightmap_uv_rect: vec2<u32>,
flags: u32,
previous_input_index: u32,
first_vertex_index: u32,
pad_a: u32,
pad_b: u32,
pad_c: u32,
}

MeshCullingData

#

At the moment, this just consists of its axis-aligned bounding box (AABB).

struct MeshCullingData {
aabb_center: vec4<f32>,
aabb_half_extents: vec4<f32>,
}

PreprocessWorkItem

#

One invocation of this compute shader: i.e. one mesh instance in a view.

struct PreprocessWorkItem {
input_index: u32,
output_index: u32,
}

IndirectParameters

#

The wgpu indirect parameters structure. This is a union of two structures. For more information, see the corresponding comment in gpu_preprocessing.rs.

struct IndirectParameters {
data0: u32,
instance_count: atomic<u32>,
first_vertex: u32,
data1: u32,
instance_index: u32,
}

Functions

view_frustum_intersects_obb

#
Active when
FRUSTUM_CULLING

aabb_center.w should be 1.0.

fn view_frustum_intersects_obb (
world_from_local: mat4x4<f32>,
aabb_center: vec4<f32>,
aabb_half_extents: vec3<f32>
) -> bool

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>
)
Contents