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

vertex_data

#
@group(3)
@binding(0)
var<storage, read> vertex_data: array<u32>

index_data

#
@group(3)
@binding(1)
var<storage, read> index_data: array<u32>

vp_params

#
@group(3)
@binding(2)
var<uniform> vp_params: VertexPullParams

Structures

Immediates

#
struct Immediates {
color: vec4<f32> ,
line_width: f32 ,
smoothing: f32 ,
@if(SIXTEEN_BYTE_ALIGNMENT)
_pad0: f32 ,
@if(SIXTEEN_BYTE_ALIGNMENT)
_pad1: f32 ,
}
struct Immediates {
color: vec4<f32> ,
}

VertexPullParams

#
struct VertexPullParams {
index_offset: u32 ,
vertex_stride: u32 ,
position_offset: u32 ,
}

WireframeVertexOutput

#
struct WireframeVertexOutput {
@builtin(position)
position: vec4<f32> ,
@location(0)
@interpolate(linear)
edge_distance: vec4<f32> ,
}

Functions

point_line_distance

#

unsigned perpendicular distance from point p to the infinite line through a and b.

fn point_line_distance (
p: vec2<f32>
, 
a: vec2<f32>
, 
b: vec2<f32>
) -> f32

read_local_position

#

finds the local-space vertex position for a given vertex index by reading from the vertex buffer using the provided parameters. the vertex buffer is interpreted as an array of u32s, so the parameters allow us to calculate the correct offset for the position attribute of the vertex at the given index.

fn read_local_position (
first_vertex: u32
, 
vertex_index: u32
) -> vec3<f32>

vertex

#
@vertex
Processes each 3D point in a model before it's drawn
fn vertex (
@builtin(vertex_index)
vertex_index: u32
, 
@builtin(instance_index)
instance_index: u32
) -> WireframeVertexOutput

fragment

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