1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00
wezterm/window/examples/shader.wgsl

14 lines
375 B
WebGPU Shading Language
Raw Normal View History

2021-05-06 19:04:16 +03:00
// vim:ft=rust:
[[stage(vertex)]]
fn vs_main([[builtin(vertex_index)]] in_vertex_index: u32) -> [[builtin(position)]] vec4<f32> {
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);
}
[[stage(fragment)]]
fn fs_main() -> [[location(0)]] vec4<f32> {
return vec4<f32>(0.4, 0.0, 0.8, 0.5);
2021-05-06 19:04:16 +03:00
}