Skip to main content

concinnity_core/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 (Metal's `ModelUniforms`), or one whose shader is still
15// hand-written per backend (the cull kernel, the per-draw morph kernel, Metal's
16// 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.
21
22pub mod bindless;
23pub mod geometry;
24pub mod post;
25pub mod probe;
26pub mod raymarch;
27pub mod transparent;
28pub mod view;
29
30pub use bindless::BINDLESS_POOL_SIZE;
31pub use geometry::{
32    DecalParams, DecalView, GpuParticle, LineView, ModelHistoryParams, ParticleView, SkinParams,
33};
34pub use post::{AutoExposureParams, HizParams, HizSpdParams, TaaParams};
35pub use probe::{MAX_PROBES, ProbePrefilterParams, ProbeSet, ProbeUniforms};
36pub use raymarch::{RaymarchShadowCascade, RaymarchView, RaymarchVolumeUniforms};
37pub use transparent::{
38    GlassMeshParams, GlassParams, TransparentView, WATER_MAX_WAVES, WaterParams, WaterWaveGpu,
39};
40pub use view::{GBufferView, ViewUniforms};