wgpu/tests/in/access.wgsl
2021-04-16 17:11:18 -04:00

9 lines
281 B
WebGPU Shading Language

// This snapshot tests accessing various containers, dereferencing pointers.
[[stage(vertex)]]
fn foo([[builtin(vertex_index)]] vi: u32) -> [[builtin(position)]] vec4<f32> {
let array = array<i32, 5>(1, 2, 3, 4, 5);
let value = array[vi];
return vec4<f32>(vec4<i32>(value));
}