Skip to main content

concinnity_render/uniforms/
mod.rs

1// src/uniforms/
2//
3// The `#[repr(C)]` blocks the CPU uploads into a single-source `.slang` shader,
4// declared once for every backend.
5//
6// These used to be declared per backend, in `metal/uniforms.rs`,
7// `vulkan/uniforms.rs` and `directx/uniforms.rs`, from the days when each
8// backend had its own shader source and its own idea of the layout. The
9// single-source migration collapsed the shader side to one declaration, and
10// `shader_layout` in concinnity-device then proved the CPU sides byte-identical
11// on all three targets -- so a second and third copy could only ever drift.
12//
13// What stays per backend is what is genuinely per backend: a block only one
14// host binds (Vulkan's combined `GbModelPush`, Metal's `ModelUniforms`), or one
15// whose shader is still hand-written per backend (the cull kernel, the legacy
16// per-draw morph kernel, the raymarch templates, Metal's water).
17//
18// Binding slots are not part of these declarations: the same block lands at a
19// different index on each backend, so where it binds belongs to the backend
20// that binds it. The one exception is called out on `ViewUniforms`, whose Metal
21// slot and field names are a published contract for world-authored shaders.
22
23pub mod bindless;
24pub mod geometry;
25pub mod post;
26pub mod probe;
27pub mod transparent;
28pub mod view;
29
30pub use bindless::BINDLESS_POOL_SIZE;
31pub use geometry::{DecalParams, DecalView, GpuParticle, LineView, ParticleView, SkinParams};
32pub use post::{AutoExposureParams, HizParams, TaaParams};
33pub use probe::{MAX_PROBES, ProbeSet, ProbeUniforms};
34pub use transparent::{
35    GlassMeshParams, GlassParams, TransparentView, WATER_MAX_WAVES, WaterParams, WaterWaveGpu,
36};
37pub use view::{GBufferModel, GBufferView, ViewUniforms};