summaryrefslogtreecommitdiff
path: root/doc/CODING_STYLE.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/CODING_STYLE.md')
-rw-r--r--doc/CODING_STYLE.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/CODING_STYLE.md b/doc/CODING_STYLE.md
index b688d6b..57d4478 100644
--- a/doc/CODING_STYLE.md
+++ b/doc/CODING_STYLE.md
@@ -170,6 +170,24 @@ fn rayMarchWithID(ro: vec3<f32>, rd: vec3<f32>, result: ptr<function, RayMarchRe
- Functional style is clearer and less error-prone
- `ptr<function, T>` adds complexity with no performance gain for small types
+### Vector and Matrix Type Aliases
+
+**Rule:** Use concise aliases for vector and matrix types (`vec3f`, `mat4x4f`) instead of the verbose generic form (`vec3<f32>`, `mat4x4<f32>`).
+
+```wgsl
+// Correct
+var p: vec3f;
+var m: mat4x4f;
+
+// Wrong
+var p: vec3<f32>;
+var m: mat4x4<f32>;
+```
+
+**Rationale:**
+- Improves readability and reduces visual noise.
+- Aligns with common graphics programming conventions.
+
---
## WGPU Object Initialization