Recursive AI

Changelog

All oneshader Go docs

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, cbuffer and ConstantBuffer<T>, textures and samplers, structured and byte-address buffers, groupshared and barriers, wave and quad intrinsics, cooperative matrices, templates as HLSL 2021 allows, inheritance, bindless resources, 16-, 64-bit and half types, 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 Compatible to 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; pipeline turns reflection into descriptor set layouts, Metal argument indices, bind group layouts and vertex input.
  • The oneshader command: DXC-compatible compile, and gen for //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: message that 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> and Store<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; on int, 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)x work. layout.Struct.Slots and layout.Member.Bits describe the units.
  • tbuffer is a read-only storage buffer laid out like a structured-buffer element (reflection kind ReadOnlyStorageBuffer), as in DXC's SPIR-V.
  • Reflection: ReflectedType.ElementBytes is the width of a matrix element when it is not 4 bytes (2 for 16-bit types, 8 for 64-bit types); written as ebytes in the text form and elementBytes in JSON.
  • Pure Go, no cgo, no dependencies; go 1.24.