summaryrefslogtreecommitdiff
path: root/workspaces/main/shaders/ellipse.wgsl
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-14 15:23:14 +0100
committerskal <pascal.massimino@gmail.com>2026-02-14 15:23:14 +0100
commitde7514e6b9ff9c0b9320975ba7d44754b5115b54 (patch)
treeef5401878f931357878c6771a3252cf4cf72175a /workspaces/main/shaders/ellipse.wgsl
parent8ce27b7e15f0fc65c8ee78950c7501660b936178 (diff)
refactor(wgsl): replace inline fullscreen_vs with common include
Replace duplicate fullscreen triangle vertex shader code with #include "render/fullscreen_vs" in 8 workspace shaders. Eliminates ~60 lines of duplication and establishes single source of truth. Modified shaders: - circle_mask_compute.wgsl (main/test) - circle_mask_render.wgsl (main/test) - ellipse.wgsl (main/test) - gaussian_blur.wgsl (main/test) Updated test_shader_assets.cc to validate include directive instead of inline @vertex keyword for affected shaders. All tests passing (34/34). handoff(Claude): Shader modularization - fullscreen_vs consolidated Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'workspaces/main/shaders/ellipse.wgsl')
-rw-r--r--workspaces/main/shaders/ellipse.wgsl10
1 files changed, 1 insertions, 9 deletions
diff --git a/workspaces/main/shaders/ellipse.wgsl b/workspaces/main/shaders/ellipse.wgsl
index 69b2712..07f0c9a 100644
--- a/workspaces/main/shaders/ellipse.wgsl
+++ b/workspaces/main/shaders/ellipse.wgsl
@@ -1,16 +1,8 @@
#include "common_uniforms"
+#include "render/fullscreen_vs"
@group(0) @binding(0) var<uniform> uniforms: CommonUniforms;
-@vertex fn vs_main(@builtin(vertex_index) i: u32) -> @builtin(position) vec4<f32> {
- var pos = array<vec2<f32>, 3>(
- vec2<f32>(-1.0, -1.0),
- vec2<f32>(3.0, -1.0),
- vec2<f32>(-1.0, 3.0)
- );
- return vec4<f32>(pos[i], 0.0, 1.0);
-}
-
fn sdEllipse(p: vec2<f32>, ab: vec2<f32>) -> f32 {
var p_abs = abs(p);
if (p_abs.x > p_abs.y) {