diff options
Diffstat (limited to 'doc/CODING_STYLE.md')
| -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). |
