diff options
Diffstat (limited to 'wgpu/src/shader')
-rw-r--r-- | wgpu/src/shader/quad.wgsl | 8 | ||||
-rw-r--r-- | wgpu/src/shader/vertex.wgsl | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/wgpu/src/shader/quad.wgsl b/wgpu/src/shader/quad.wgsl index 555e81bb..f919cfe2 100644 --- a/wgpu/src/shader/quad.wgsl +++ b/wgpu/src/shader/quad.wgsl @@ -37,11 +37,3 @@ fn select_border_radius(radi: vec4<f32>, position: vec2<f32>, center: vec2<f32>) rx = select(rx, ry, position.y > center.y); return rx; } - -// Compute the normalized quad coordinates based on the vertex index. -fn vertex_position(vertex_index: u32) -> vec2<f32> { - // #: 0 1 2 3 4 5 - // x: 1 1 0 0 0 1 - // y: 1 0 0 0 1 1 - return vec2<f32>((vec2(1u, 2u) + vertex_index) % 6u < 3u); -} diff --git a/wgpu/src/shader/vertex.wgsl b/wgpu/src/shader/vertex.wgsl new file mode 100644 index 00000000..904f8470 --- /dev/null +++ b/wgpu/src/shader/vertex.wgsl @@ -0,0 +1,7 @@ +// Compute the normalized quad coordinates based on the vertex index. +fn vertex_position(vertex_index: u32) -> vec2<f32> { + // #: 0 1 2 3 4 5 + // x: 1 1 0 0 0 1 + // y: 1 0 0 0 1 1 + return vec2<f32>((vec2(1u, 2u) + vertex_index) % 6u < 3u); +} |