1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-04 17:18:23 -05:00
denoland-deno/tests/testdata/webgpu/hellotriangle_shader.wgsl

20 lines
454 B
WebGPU Shading Language

// only test purpose
override value: f32;
@vertex
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4<f32> {
// only test purpose
_ = value;
let x = f32(i32(in_vertex_index) - 1);
let y = f32(i32(in_vertex_index & 1u) * 2 - 1);
return vec4<f32>(x, y, 0.0, 1.0);
}
@fragment
fn fs_main() -> @location(0) vec4<f32> {
// only test purpose
_ = value;
return vec4<f32>(1.0, 0.0, 0.0, 1.0);
}