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

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

index_data

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

vp_params

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

Structures

Immediates

#
struct Immediates {
color: vec4<f32>, WIREFRAME_WIDE
line_width: f32, WIREFRAME_WIDE
smoothing: f32, WIREFRAME_WIDE
_pad0: f32, WIREFRAME_WIDE AND SIXTEEN_BYTE_ALIGNMENT
_pad1: f32, WIREFRAME_WIDE AND SIXTEEN_BYTE_ALIGNMENT
}
struct Immediates {
color: vec4<f32>, !WIREFRAME_WIDE
}

VertexPullParams

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

WireframeVertexOutput

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

Functions

point_line_distance

#
Active when
WIREFRAME_WIDE

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

#
Active when
WIREFRAME_WIDE

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
Active when
WIREFRAME_WIDE
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
Active when
WIREFRAME_WIDE
fn fragment ( ) ->
@location(0)
vec4<f32>
Active when
!WIREFRAME_WIDE
fn fragment ( ) ->
@location(0)
vec4<f32>
Contents