Skip to main content

Module uniforms

Module uniforms 

Source
Expand description

repr(C) uniform / push-constant structs only the Vulkan frame encoders bind (std140 / std430 / push-constant layouts). Each is mirrored field-for-field in a .glsl/.vert/.frag/.comp shader under vulkan/shaders/, or in the one .slang block Vulkan alone declares.

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§

CullHizParams
Cull-side Hi-Z uniforms (cull.comp, std140, 80 bytes): the previous frame’s un-jittered view-projection, the Hi-Z mip-0 dimensions, the mip count, and an enable flag. Mirrors the Metal / DirectX CullUniforms tail.
CullParams
The GPU-cull push constant (cull.comp, std430): six already-normalised frustum planes (xyz = normal, w = d), the camera position sharing its 16-byte slot with the build-time object count, then the shader-bucket routing (120 B total).
GbModelPush
The G-buffer pre-pass push constant (shared GLSL PushBlock): cur_model then prev_model (two column-major mat4) then roughness, plus a trailing pad to 16-byte alignment. The motion vector reads cur/prev model; the fragment reads roughness.
MainPush
The main-pass push constant (std430): the model matrix, roughness/metallic with two pads, then tint and emissive vec3s each followed by a pad (112 B total). Matches ModelUniforms(64) + MaterialUniforms(48) packed together.
RaymarchView
The raymarch pass per-frame view UBO (raymarch_helpers.glsl RaymarchViewBlock, std140, 160 bytes). Mirrors the DirectX / Metal RaymarchView.
RaymarchVolumeUniforms
The per-volume SDF raymarch UBO (SdfVolumeBlock, std140, 176 bytes). Mirrors the DirectX RaymarchVolumeUniforms.

Constants§

AUTO_EXPOSURE_PUSH_BYTES
Byte size of the auto-exposure push-constant range. Pins the struct size to what the pipeline layout declares.
GBUFFER_PREPASS_PUSH_BYTES
Byte size of the G-buffer pre-pass push-constant range (cur_model 64 + prev_model 64 + roughness 4 + 12 pad). Pins the struct size.