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

view

#
@group(0)
@binding(0)
var<uniform> view: View

globals

#
@group(0)
@binding(1)
var<uniform> globals: Globals

sprite_texture

#
@group(1)
@binding(0)
var sprite_texture: texture_2d<f32>

sprite_sampler

#
@group(1)
@binding(1)
var sprite_sampler: sampler

Structures

UiVertexOutput

#
struct UiVertexOutput {
@location(0)
uv: vec2<f32> ,
@location(1)
color: vec4<f32> ,
@location(2)
@interpolate(flat)
texture_slices: vec4<f32> ,
@location(3)
@interpolate(flat)
target_slices: vec4<f32> ,
@location(4)
@interpolate(flat)
repeat: vec4<f32> ,
@location(5)
@interpolate(flat)
atlas_rect: vec4<f32> ,
@builtin(position)
position: vec4<f32> ,
}

Functions

vertex

#
@vertex
Processes each 3D point in a model before it's drawn
fn vertex (
@location(0)
vertex_position: vec3<f32>
, 
@location(1)
vertex_uv: vec2<f32>
, 
@location(2)
vertex_color: vec4<f32>
, 
@location(3)
texture_slices: vec4<f32>
, 
@location(4)
target_slices: vec4<f32>
, 
@location(5)
repeat: vec4<f32>
, 
@location(6)
atlas_rect: vec4<f32>
) -> UiVertexOutput

map_axis_with_repeat

#

maps a point along the axis of the render target to slice coordinates Arguments: - p: normalized distance along the axis - il: target min dividing point - ih: target max dividing point - tl: slice min dividing point - th: slice max dividing point - r: number of times to repeat the slice for sides and the center

fn map_axis_with_repeat (
p: f32
, 
il: f32
, 
ih: f32
, 
tl: f32
, 
th: f32
, 
r: f32
) -> f32

map_uvs_to_slice

#
fn map_uvs_to_slice (
uv: vec2<f32>
, 
target_slices: vec4<f32>
, 
texture_slices: vec4<f32>
, 
repeat: vec4<f32>
) -> vec2<f32>

fragment

#
@fragment
Calculates the final color of each pixel on the screen
fn fragment ( ) ->
@location(0)
vec4<f32>
Contents