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.

ui_texture_slice.wgsl

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

fn map_axis_with_repeat ( ) -> f32

map_uvs_to_slice

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

fragment

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