From e10eea9d89440c9494c86433c15baaca58705ffd Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 10 Mar 2026 09:14:13 +0100 Subject: 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 --- doc/CODING_STYLE.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc') 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). -- cgit v1.2.3