Restore abs() in the rect shader, and validate every shader without a device
`7c50a3e` renamed a length's `abs` component to `px` and took the WGSL `abs()` builtin in the rounded-rect distance with it, so every window failed shader validation on the first frame while `cargo test` stayed green. `naga` is reachable through `wgpu`, so a unit test now composes each shader file with the prelude the way the renderer does and parses and validates it; it reads the shader directory rather than naming primitives, so a new one is covered by adding its file. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
02ff8c7454
commit
f61e8936f1
2 files changed
+38
-2
No files matched your search
@@ -34,6 +34,6 @@ fn distance_from_rect(pixel_pos: vec2<f32>, rect_center: vec2<f32>, rect_corner:
|
||||
// vec from center to pixel
|
||||
let p = pixel_pos - rect_center;
|
||||
// vec from inner rect corner to pixel
|
||||
let q = px(p) - (rect_corner - radius);
|
||||
let q = abs(p) - (rect_corner - radius);
|
||||
return length(max(q, vec2(0.0))) - radius;
|
||||
}
|
||||
Reference in new issue
Block a user