mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-22 15:32:35 +00:00
The Module -> word-stream encoder's first half: a fast single-pass word writer (one host-endian store per word; instruction headers written as a placeholder and backpatched, so variable-length instructions need no measure pass) plus the header and the preamble / debug / annotation sections in spec layout order (capabilities, extensions, ext-inst imports, memory model, entry points, execution modes, OpString/OpSource/OpName, decorations). Validated: a minimal module encodes to byte-exact-correct SPIR-V (magic, v1.5, OpCapability Shader, OpMemoryModel Logical GLSL450, OpEntryPoint GLCompute %main, NUL-terminated 'main' string, correct backpatched word counts). Types/constants/globals/function bodies (the <id> + type lowering) are next.