summaryrefslogtreecommitdiff
path: root/cnn_v1/shaders/cnn_layer.wgsl
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-21 09:44:17 +0100
committerskal <pascal.massimino@gmail.com>2026-02-21 09:50:09 +0100
commitde9bc553ed0e8bda42057ac441936c20a8185f60 (patch)
tree1d7417510512b670bf3ce14c18020b45e5baec24 /cnn_v1/shaders/cnn_layer.wgsl
parente0f326e23f6b96f31ce9e8bbd5b5f2233e6a90ba (diff)
refactor(wgsl): Use vec*f alias for vector types
Replaces all instances of `vec<f32>` 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.
Diffstat (limited to 'cnn_v1/shaders/cnn_layer.wgsl')
-rw-r--r--cnn_v1/shaders/cnn_layer.wgsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/cnn_v1/shaders/cnn_layer.wgsl b/cnn_v1/shaders/cnn_layer.wgsl
index cbd1686..c35cb39 100644
--- a/cnn_v1/shaders/cnn_layer.wgsl
+++ b/cnn_v1/shaders/cnn_layer.wgsl
@@ -33,7 +33,7 @@ struct CNNLayerParams {
let uv = (p.xy - 0.5) / (uniforms.resolution - 1.0);
let original_raw = textureSample(original_input, smplr, uv);
let original = (original_raw - 0.5) * 2.0; // Normalize to [-1,1]
- let gray = (dot(original_raw.rgb, vec3<f32>(0.2126, 0.7152, 0.0722)) - 0.5) * 2.0;
+ let gray = (dot(original_raw.rgb, vec3f(0.2126, 0.7152, 0.0722)) - 0.5) * 2.0;
var result = vec4<f32>(0.0);
// Layer 0: 7→4 (RGBD output, normalizes [0,1] input)