draw

module pkg::alloy::gpu::shader::mslsource

Metal's shading language from the shader compiler's SPIR-V (PLAN.md, F7b): the module the compiler wrote from the checked WGSL, its types, layouts and control flow already settled, read back and written as MSL source, which the Metal device compiles while the program runs. Only what the compiler emits is read: structured selections and loops, no phi.

Every value gets a variable declared at the top of its function, so structured control flow needs no scopes; components are read by index (v[1]), never by swizzle. Structs that buffers hold keep their WGSL offsets through padding, a 3-component vector in one being packed. A function reads the resources it uses, its callees' too, as parameters. An entry point name becomes alloy_name, its resources at the Metal indices metal_index gives, its stage's inputs and outputs in structs.