From de9bc553ed0e8bda42057ac441936c20a8185f60 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 21 Feb 2026 09:44:17 +0100 Subject: refactor(wgsl): Use vec*f alias for vector types Replaces all instances of `vec` with the more concise `vec*f` alias (e.g., `vec3f`) across all `.wgsl` shaders. This improves readability and aligns with common graphics programming conventions. Also adds a new coding style rule to `doc/CODING_STYLE.md` to enforce this standard going forward. Finally, this commit fixes a build error in `test_effect_base.cc` by replacing a call to the non-existent `wgpuDeviceTick` with `wgpuDevicePoll`, which resolves the test failure. --- cnn_v1/shaders/cnn_conv1x1.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cnn_v1/shaders/cnn_conv1x1.wgsl') diff --git a/cnn_v1/shaders/cnn_conv1x1.wgsl b/cnn_v1/shaders/cnn_conv1x1.wgsl index f77cfa8..a6fb84a 100644 --- a/cnn_v1/shaders/cnn_conv1x1.wgsl +++ b/cnn_v1/shaders/cnn_conv1x1.wgsl @@ -45,7 +45,7 @@ fn cnn_conv1x1_7to4_src( let step = 1.0 / resolution; var original = (textureSample(tex, samp, uv) - 0.5) * 2.0; - let gray = dot(original.rgb, vec3(0.2126, 0.7152, 0.0722)); + let gray = dot(original.rgb, vec3f(0.2126, 0.7152, 0.0722)); let uv_norm = (uv - 0.5) * 2.0; let in1 = vec4(uv_norm, gray, 1.0); -- cgit v1.2.3