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

c1

#
const c1: AbstractInt = 1

c2

#
const c2: u32 = 2

o1

#
const o1: f32 = override o1: f32

o2

#
const o2: AbstractInt = 0

o3

#
const o3: u32 = 0

l1

#
const l1: AbstractInt = 0

l2

#
const l2: AbstractInt = 0i

l3

#
const l3: u32 = 0u

l4

#
const l4: AbstractInt = 123

l5

#
const l5: AbstractInt = 456i

l6

#
const l6: u32 = 789u

l7

#
const l7: AbstractInt = 0x0

l8

#
const l8: AbstractInt = 0xff

l9

#
const l9: u32 = 0Xffu

l10

#
const l10: AbstractInt = 0xFFi

l11

#
const l11: bool = true

l12

#
const l12: bool = false

l13

#
const l13: AbstractInt = 0f

l14

#
const l14: AbstractInt = 0h

l15

#
const l15: AbstractInt = 1f

l16

#
const l16: AbstractInt = 1h

l17

#
const l17: AbstractFloat = 0.5

l18

#
const l18: AbstractFloat = .5

l19

#
const l19: AbstractFloat = 1.

l20

#
const l20: AbstractFloat = 1.5e10

l21

#
const l21: AbstractFloat = 1.5e-10

l22

#
const l22: AbstractFloat = 1.5E+10f

l23

#
const l23: AbstractFloat = 0.5h

l24

#
const l24: AbstractInt = 1e10

l25

#
const l25: AbstractInt = 1e-10f

l26

#
const l26: AbstractInt = 0x1p4

l27

#
const l27: AbstractFloat = 0x1.8p4

l28

#
const l28: AbstractFloat = 0x.8p0

l29

#
const l29: AbstractFloat = 0x1.p0f

l30

#
const l30: AbstractInt = 0x1p-4h

Bindings

vu1

#
@group(0)
@binding(1)
var<uniform> vu1: u32

vh1

#
@group(0)
@binding(2)
var vh1: texture_2d<f32>

vh2

#
@group(0)
@binding(3)
var vh2: sampler

vs1

#
@group(0)
@binding(4)
var<storage> vs1: u32

vs2

#
@group(0)
@binding(5)
var<storage,read> vs2: u32

vs4

#
@group(0)
@binding(6)
var<storage,read_write> vs4: u32

vs5

#
@group(0)
@binding(7)
var<storage,read_write> vs5: atomic<u32>

Structures

S1

#

structs

struct S1 {
m1: u32 ,
}

S2

#
struct S2 {
m1: u32 ,
m2: f32 ,
}

S3

#
struct S3 {
@align(16)
m1: u32 ,
@size(32)
m2: f32 ,
@align(8)
@size(4)
m3: i32 ,
m4: vec3<f32> ,
m5: array<u32, 4> ,
m6: S2 ,
}

S4

#
struct S4 {
@location(0)
@interpolate(flat)
m1: f32 ,
@builtin(position)
m2: vec4<f32> ,
@location(1)
@interpolate(perspective, center)
m3: f32 ,
@location(2,)
@interpolate(linear, centroid,)
m4: f32 ,
@location(3)
@interpolate(flat, first)
m5: f32 ,
@invariant()
@builtin(position)
m6: vec4<f32> ,
}

Functions

f1

#

function with no return type and empty body

fn f1 ()

f2

#

function with parameters

fn f2 (
p1: u32
, 
p2: f32
)

f3

#

function with attributes on params, and trailing comma

fn f3 (
@builtin(vertex_index)
p1: u32
, 
p2: f32
) -> u32

f4

#

function with return type and return attribute

fn f4 () ->
@location(0)
vec4<f32>

f5

#

must_use attribute

fn f5 () -> u32

f7

#

expressions

fn f7 ()

f8

#

statements

fn f8 ()

f9

#

function returning value with various return forms

fn f9 (
p1: bool
) -> u32

f10

#
@fragment
Calculates the final color of each pixel on the screen

discard is only valid in fragment shaders

fn f10 () ->
@location(0)
vec4<f32>

vert_main

#
@vertex
Processes each 3D point in a model before it's drawn

entry points with stage attributes

fn vert_main (
@builtin(vertex_index)
p1: u32
) ->
@builtin(position)
vec4<f32>

frag_main

#
@fragment
Calculates the final color of each pixel on the screen
fn frag_main (
@builtin(position)
p1: vec4<f32>
, 
@location(0)
@interpolate(flat)
p2: f32
) ->
@location(0)
vec4<f32>

comp_main1

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(1)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn comp_main1 ()

comp_main2

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn comp_main2 (
@builtin(global_invocation_id)
p1: vec3<u32>
)

comp_main3

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8, 1, )
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn comp_main3 (
@builtin(local_invocation_id)
p1: vec3<u32>
, 
@builtin(local_invocation_index)
p2: u32
, 
@builtin(workgroup_id)
p3: vec3<u32>
, 
@builtin(num_workgroups)
p4: vec3<u32>
)

f11

#

pointers as parameters

fn f11 (
p1: ptr<function, u32>
)

f12

#
fn f12 ()

f13

#

nested member and swizzle write targets

fn f13 ()
Contents