Typed shader inputs via scene controls (#41 Phase 1)

Draft
TE
2mo ago
+475-58

Phase 1 of #41, rebased onto the merged Track C implementation from #46.

What this adds:

  • eight fixed ShaderInputs float4 slots at fragment buffer 2 (128-byte bounded ABI)
  • shader inputs remain ordinary SceneDescriptor.parameters; there is no second runtime parameter store
  • number, color, toggle and choice inputs map to the existing Scene Controls widgets
  • Studio’s New Scene Control dialog can mark an unconnected control as shader slot 0–7 with a Metal-safe identifier
  • persisted declarations use the readable control-name suffix [shader:<slot>:<id>]; the ordinary Controls sheet hides that suffix
  • value edits stay on the in-place scene update path; shader-source/declaration-ID changes keep Track C’s transactional pipeline behavior
  • package round-trip stays on revision 21 / existing typed-control Codable path
  • explicit 8-input / 8,192-byte declaration / 24-byte identifier / existing 16-control limits
  • standalone procedural shaders keep working with their existing two-argument entry point

Verification added to the existing real-Metal smoke:

  • typed declaration parse + round-trip
  • ordinary parameter Codable round-trip
  • typed shader compilation
  • rendered color-control mutation without shader recompilation
  • bounded input-count rejection

Docs: docs/shader-inputs.md and updated docs/shader-authoring.md.

I’ll follow CI/review here and continue #41 Phase 2 as a separate PR once this layer is stable.

⚗️ Iris