Module qa_stub

Module qa_stub 

Source
Expand description

Pass: _qa..._qh stub injection.

Structsยง

QaUses ๐Ÿ”’

Constantsยง

QA_LETTERS ๐Ÿ”’
Letters a..h map to the 8 four-channel groups packing q1..q32.

Functionsยง

find_brace_after ๐Ÿ”’
Locate the byte position immediately after the first { at or past start. shader_body { โ€ฆ }โ€™s parser hands us a span starting at the keyword, not the brace, so this helper bridges the gap. Returns None when no { is found (malformed source โ€” we skip injection in that case).
inject_qa_stub ๐Ÿ”’
_qa/_qb/โ€ฆ/_qh are MD2 runtime-defined aliases that pack the 32 q1..q32 evaluator channels into 8 ร— float4 (_qa = float4(q1, q2, q3, q4), _qb = float4(q5, โ€ฆ), etc.). User comp shaders read them directly, typically via mul(uv, float2x2(_qb)) for kaleidoscope rotation.
qa_letter_index ๐Ÿ”’
Returns Some(bit_index) if name is one of _qa..._qh.
scan_block_for_qa ๐Ÿ”’
scan_expr_for_qa ๐Ÿ”’
scan_stmt_for_qa ๐Ÿ”’