All notable changes to recursiveai.org/go/oneshader. Versions follow Semantic Versioning.
[1.0.0] - 2026-12-04
First release.
- Compiler: modern HLSL (structs, functions and overloads,
cbufferandConstantBuffer<T>, textures and samplers, structured and byte-address buffers,groupsharedand barriers, wave and quad intrinsics, cooperative matrices, templates as HLSL 2021 allows, inheritance, bindless resources, 16-, 64-bit andhalftypes, the preprocessor) for vertex, pixel and compute stages. - Targets: SPIR-V (Vulkan 1.2 and 1.3), Metal Shading Language, WGSL and DXIL (shader model 6.0 to 6.8), from one IR with a verifier and an optimizer (
ir,ir/opt). - Reflection for every compile: entry points, stage variables, resource slots per target, buffer layouts with byte offsets, push constants, specialization constants, required device features. JSON form with a reader, and
Compatibleto check a reflection against a pipeline layout. - One byte layout per buffer on every target (DXC's Vulkan defaults); push constants; Vulkan, MSL, WGSL and DXIL binding models;
pipelineturns reflection into descriptor set layouts, Metal argument indices, bind group layouts and vertex input. - The
oneshadercommand: DXC-compatiblecompile, andgenfor//go:generate, which writes Go structs laid out to the shared byte layout with compile-time size and offset checks, binding constants, shader variants and//go:embed-ed blobs. - Diagnostics as
file(line,col): error OSHnnnn: messagethat say what to do; every limit on untrusted input (include depth and count, macro expansion, nesting, IR size) is configurable and has a diagnostic. - Deterministic output: the same input and options give byte-identical blobs, reflection and generated code.
ByteAddressBuffer.Load<T>andStore<T>take structs, arrays and matrices as well as scalars and vectors, on every target: members at the offsets a structured-buffer element has, matrices as DXC moves them (columns one after another, no padding), at most 4096 scalars per call.- Bit-fields (
uint a : 3;onint,uint,int16_t,uint16_t,int64_t,uint64_t): consecutive bit-fields of one type share a storage unit from the lowest bit up, a different type or a field that does not fit starts a new unit, as DXC lays them out. The unit is an ordinary member in reflection (named after its first bit-field). Reads sign-extend signed fields, writes drop the bits above the width; compound assignment,++, initializer lists and(S)xwork.layout.Struct.Slotsandlayout.Member.Bitsdescribe the units. tbufferis a read-only storage buffer laid out like a structured-buffer element (reflection kindReadOnlyStorageBuffer), as in DXC's SPIR-V.- Reflection:
ReflectedType.ElementBytesis the width of a matrix element when it is not 4 bytes (2 for 16-bit types, 8 for 64-bit types); written asebytesin the text form andelementBytesin JSON. - Pure Go, no cgo, no dependencies;
go 1.24.