Skip to main content

Module uniforms

Module uniforms 

Source
Expand description

repr(C) uniform / root-constant structs only the DirectX frame encoders bind (cbuffer / root-constant layouts). Each is mirrored field-for-field in an .hlsl shader under directx/shaders/.

Blocks whose shader counterpart is a single-source .slang declaration are declared once for every backend in crate::uniforms; what is left here is what only this backend binds. Their layouts are checked by shader_layout in concinnity-device, which reads the expected offsets out of slangc’s reflection per target. The hand-written asserts below are for the families whose shaders are still per backend – the cull kernel, the skinning and morph kernels, the raymarch SDF templates, the legacy per-draw main and velocity passes, and Metal’s water.

Structs§

CullParams
The GPU-cull CullParams cbuffer (b0, 208 bytes): six already-normalised frustum planes, the camera position sharing its row with the object count, the previous frame’s view-projection, the Hi-Z metadata (dims, mip count, enable flag), then the shader-bucket routing. DirectX fuses the cull + Hi-Z uniforms into one cbuffer.
RaymarchView
The raymarch pass per-frame RaymarchView cbuffer (b0, 160 bytes; aligned to 256 for the D3D12 cbuffer). Mirrors the Metal RaymarchView.
RaymarchVolumeUniforms
The per-volume SdfVolumeUniforms cbuffer (b1, 176 bytes; aligned to 256 in the cbuffer allocation).