Expand description
SPIR-V utilities for the Level Zero compute backend.
This module provides a minimal SPIR-V module builder and a pre-encoded
placeholder compute shader. The placeholder is a valid “do nothing”
void main() with LocalSize(1,1,1) that satisfies Level Zero
requirements for module creation, even though all compute
operations in this backend currently return Unsupported.
§SPIR-V binary format
SPIR-V is a sequence of 32-bit words (little-endian on all current platforms). Each instruction is encoded as:
word[0] = (word_count << 16) | opcode
word[1..n] = operandsThe module header is always five words:
0x07230203 magic
version e.g. 0x00010500 = 1.5
generator arbitrary; we use 0x000D_0002
bound highest ID used + 1
schema reserved (0)Structs§
- SpvModule
- Lightweight SPIR-V word-stream builder.
Constants§
- SPIRV_
GENERATOR - Generator magic — OxiCUDA Level Zero backend.
- SPIRV_
MAGIC - SPIR-V magic number (identifies a binary as SPIR-V).
- SPIRV_
VERSION_ 1_ 2 - SPIR-V version 1.2 (widely supported, no ray-tracing extras needed).
Functions§
- trivial_
compute_ shader - Build a minimal valid compute shader:
void main() {}withLocalSize(1,1,1). - trivial_
compute_ shader_ bytes - Return the trivial compute shader as a byte slice suitable for passing to Level Zero module creation.