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

transform

#
@group(0)
@binding(0)
var<uniform> transform: Transform

image_texture

#
Active when
BINDLESS
@group(1)
@binding(0)
var image_texture: binding_array<texture_2d<f32>>
Active when
!BINDLESS
@group(1)
@binding(0)
var image_texture: texture_2d<f32>

image_sampler

#
Active when
BINDLESS
@group(1)
@binding(1)
var image_sampler: binding_array<sampler>
Active when
!BINDLESS
@group(1)
@binding(1)
var image_sampler: sampler

Structures

Transform

#
struct Transform {
scale: vec2<f32>,
translation: vec2<f32>,
}

VertexInput

#
struct VertexInput {
@location(0)
position: vec2<f32>,
@location(1)
uv: vec2<f32>,
@location(2)
color: vec4<f32>,
}

VertexOutput

#
struct VertexOutput {
@builtin(position)
position: vec4<f32>,
@location(0)
color: vec4<f32>,
@location(1)
uv: vec2<f32>,
}

Functions

linear_from_gamma_rgb

#

0-1 linear from 0-1 sRGB gamma.

fn linear_from_gamma_rgb (
srgb: vec3<f32>
) -> vec3<f32>

gamma_from_linear_rgb

#

0-1 sRGB gamma from 0-1 linear.

fn gamma_from_linear_rgb (
rgb: vec3<f32>
) -> vec3<f32>

gamma_from_linear_rgba

#

0-1 sRGBA gamma from 0-1 linear.

fn gamma_from_linear_rgba (
linear_rgba: vec4<f32>
) -> vec4<f32>

vs_main

#
@vertex
Processes each 3D point in a model before it's drawn
fn vs_main ( ) -> VertexOutput

fs_main

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