diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-10 09:14:13 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-10 09:14:13 +0100 |
| commit | e10eea9d89440c9494c86433c15baaca58705ffd (patch) | |
| tree | 7c91e6d5ac70c355741070be53878694b9836441 /doc | |
| parent | dd0dba4bdfd5d742a190b86115bde5107329f8ab (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>
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/CODING_STYLE.md | 18 |
1 files changed, 18 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). |
