Back home 🏡 WGSL Spec Bevy WGSL Functions

visibility_buffer_hardware_raster.wgsl

Structures

VertexOutput

#
Annotation Name Type Shader Def
builtin(position) position vec4<f32>
location(0) unclamped_clip_depth f32 🟢 DEPTH_CLAMP_ORTHO

Functions

vertex

#
@vertex
fn vertex(instance_index: u32, vertex_index: u32) -> VertexOutput
Parameter Type
instance_index u32
vertex_index u32
Returns: VertexOutput

fragment

#
@fragment
fn fragment(vertex_output: VertexOutput)
Parameter Type
vertex_output VertexOutput

dummy_vertex

#
fn dummy_vertex() -> VertexOutput
Returns: VertexOutput

divide

#
Naga doesn't allow divide by zero literals, but this lets us work around it
fn divide(a: f32, b: f32) -> f32
Parameter Type
a f32
b f32
Returns: f32