summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-10 09:14:13 +0100
committerskal <pascal.massimino@gmail.com>2026-03-10 09:14:13 +0100
commite10eea9d89440c9494c86433c15baaca58705ffd (patch)
tree7c91e6d5ac70c355741070be53878694b9836441
parentdd0dba4bdfd5d742a190b86115bde5107329f8ab (diff)
style: require 2-line header comment in all .wgsl files
Add rule to CODING_STYLE.md and apply to ntsc.wgsl. handoff(Claude): rule added, ntsc.wgsl patched; scratch_lines and color_c64 already compliant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rw-r--r--doc/CODING_STYLE.md18
-rw-r--r--src/effects/ntsc.wgsl2
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/CODING_STYLE.md b/doc/CODING_STYLE.md
index ba3fcb5..7d45027 100644
--- a/doc/CODING_STYLE.md
+++ b/doc/CODING_STYLE.md
@@ -166,6 +166,24 @@ Three-line header for all source files.
## WGSL Shader Style
+### File Header (Required)
+
+Every `.wgsl` file must start with a 2-line comment header:
+
+```wgsl
+// Line 1: What the shader/snippet does (one sentence).
+// Line 2: Role, main outputs, or public API surface.
+```
+
+Example:
+```wgsl
+// NTSC post-process effect: fisheye distortion, scanlines, and color bleeding.
+// Produces a retro CRT/NTSC look using YIQ color space and C64-style dithering.
+```
+
+---
+
+
### Return vs Pointer Parameters
**Rule:** Prefer return values over pointer parameters for small structs (≤16 bytes).
diff --git a/src/effects/ntsc.wgsl b/src/effects/ntsc.wgsl
index ea2fb59..e0182f3 100644
--- a/src/effects/ntsc.wgsl
+++ b/src/effects/ntsc.wgsl
@@ -1,3 +1,5 @@
+// NTSC post-process effect: fisheye distortion, scanlines, and color bleeding.
+// Produces a retro CRT/NTSC look using YIQ color space and C64-style dithering.
#include "sequence_uniforms"
#include "render/fullscreen_uv_vs"
#include "math/noise"