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.

Constants

TAU

#
const TAU: f32 = 2. * PI

RIGHT_VERTEX

#
const RIGHT_VERTEX: u32 = 2u

BOTTOM_VERTEX

#
const BOTTOM_VERTEX: u32 = 4u

RADIAL

#
const RADIAL: u32 = 16u

FILL_START

#
const FILL_START: u32 = 32u

FILL_END

#
const FILL_END: u32 = 64u

CONIC

#
const CONIC: u32 = 128u

BORDER_LEFT

#
const BORDER_LEFT: u32 = 256u

BORDER_TOP

#
const BORDER_TOP: u32 = 512u

BORDER_RIGHT

#
const BORDER_RIGHT: u32 = 1024u

BORDER_BOTTOM

#
const BORDER_BOTTOM: u32 = 2048u

BORDER_ANY

#
const BORDER_ANY: u32 = BORDER_LEFT + BORDER_TOP + BORDER_RIGHT + BORDER_BOTTOM

Bindings

view

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

Structures

GradientVertexOutput

#
struct GradientVertexOutput {
@location(0)
uv: vec2<f32> ,
@location(1)
@interpolate(flat)
size: vec2<f32> ,
@location(2)
@interpolate(flat)
flags: u32 ,
@location(3)
@interpolate(flat)
radius_x: vec4<f32> ,
@location(4)
@interpolate(flat)
radius_y: vec4<f32> ,
@location(5)
@interpolate(flat)
border: vec4<f32> ,
@location(6)
point: vec2<f32> ,
@location(7)
@interpolate(flat)
g_start: vec2<f32> ,
@location(8)
@interpolate(flat)
dir: vec2<f32> ,
@location(9)
@interpolate(flat)
start_color: vec4<f32> ,
@location(10)
@interpolate(flat)
start_len: f32 ,
@location(11)
@interpolate(flat)
end_len: f32 ,
@location(12)
@interpolate(flat)
end_color: vec4<f32> ,
@location(13)
@interpolate(flat)
hint: f32 ,
@builtin(position)
position: vec4<f32> ,
}

Functions

enabled

#
fn enabled (
flags: u32
, 
mask: u32
) -> bool

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)
flags: u32
, 
@location(3)
radius_x: vec4<f32>
, 
@location(4)
radius_y: vec4<f32>
, 
@location(5)
border: vec4<f32>
, 
@location(6)
size: vec2<f32>
, 
@location(7)
point: vec2<f32>
, 
@location(8)
@interpolate(flat)
g_start: vec2<f32>
, 
@location(9)
@interpolate(flat)
dir: vec2<f32>
, 
@location(10)
@interpolate(flat)
start_color: vec4<f32>
, 
@location(11)
@interpolate(flat)
start_len: f32
, 
@location(12)
@interpolate(flat)
end_len: f32
, 
@location(13)
@interpolate(flat)
end_color: vec4<f32>
, 
@location(14)
@interpolate(flat)
hint: f32
) -> GradientVertexOutput

fragment

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

rem_euclid

#
fn rem_euclid (
a: f32
, 
b: f32
) -> f32

linear_distance

#
fn linear_distance (
point: vec2<f32>
, 
g_start: vec2<f32>
, 
g_dir: vec2<f32>
) -> f32

radial_distance

#
fn radial_distance (
point: vec2<f32>
, 
center: vec2<f32>
, 
ratio: f32
) -> f32

conic_distance

#
fn conic_distance (
start: f32
, 
point: vec2<f32>
, 
center: vec2<f32>
) -> f32

mix_colors

#

Mix the colors, choosing the appropriate interpolation method for the given color space

fn mix_colors (
start_color: vec3<f32>
, 
end_color: vec3<f32>
, 
t: f32
) -> vec3<f32>

convert_to_linear_rgba

#

Convert a color from the interpolation color space to linear rgba

fn convert_to_linear_rgba (
color: vec4<f32>
) -> vec4<f32>

interpolate_gradient

#
fn interpolate_gradient (
distance: f32
, 
start_color: vec4<f32>
, 
start_distance: f32
, 
end_color: vec4<f32>
, 
end_distance: f32
, 
hint: f32
, 
flags: u32
) -> vec4<f32>
Contents