Back home 🏡 WGSL Spec Bevy WGSL Functions

sprite.wgsl

Bindings

Name Group Binding index Binding type Type
sprite_texture # 1 0 texture_2d<f32>
sprite_sampler # 1 1 sampler

Structures

VertexInput

#
Annotation Name Type
builtin(vertex_index) index u32
location(0) i_model_transpose_col0 vec4<f32>
location(1) i_model_transpose_col1 vec4<f32>
location(2) i_model_transpose_col2 vec4<f32>
location(3) i_color vec4<f32>
location(4) i_uv_offset_scale vec4<f32>

VertexOutput

#
Annotation Name Type
builtin(position) clip_position vec4<f32>
location(0) uv vec2<f32>

Functions

vertex

#
@vertex
fn vertex(in: VertexInput) -> VertexOutput
Parameter Type
in VertexInput
Returns: VertexOutput

fragment

#
@fragment
fn fragment(in: VertexOutput) -> @location(0) vec4<f32>
Parameter Type
in VertexOutput
Returns: @location(0) vec4<f32>