concinnity_render/uniforms/post.rs
1//! The small parameter blocks the fullscreen post passes and the two compute
2//! helpers that feed them take.
3
4/// Input to the TAA resolve fragment shader. Matches `TaaParams` in
5/// `shaders/taa.slang`. 4 bytes.
6#[derive(Copy, Clone, bytemuck::NoUninit)]
7#[repr(C)]
8pub struct TaaParams {
9 /// 0 on the first frame / after a resize, 1.0 otherwise.
10 pub history_valid: f32,
11}
12
13/// Input to the auto-exposure histogram kernels: the three luminance-mapping
14/// scalars then a pad rounding to 16 bytes. Matches `AutoExposureParams` in
15/// `shaders/auto_exposure.slang`.
16#[derive(Copy, Clone, bytemuck::NoUninit)]
17#[repr(C)]
18pub struct AutoExposureParams {
19 /// Lowest log2(luminance) the histogram covers.
20 pub lum_log2_min: f32,
21 /// Width of the log2(luminance) span the histogram covers (max - min).
22 pub lum_log2_range: f32,
23 /// `HISTOGRAM_BINS / lum_log2_range`. The build kernel multiplies the
24 /// centred log-luminance by this to derive a bin index.
25 pub lum_to_bin_scale: f32,
26 /// Padding so the field layout matches the shader-side struct.
27 pub _pad: f32,
28}
29
30/// Per-dispatch params for the Hi-Z build kernels: four tightly-packed uints.
31/// Matches `HizParams` in `shaders/hiz_build.slang`. 16 bytes.
32#[derive(Copy, Clone, bytemuck::NoUninit)]
33#[repr(C)]
34pub struct HizParams {
35 /// Destination width in pixels.
36 pub dst_width: u32,
37 /// Destination height in pixels.
38 pub dst_height: u32,
39 /// Source mip level sampled.
40 pub src_mip: u32,
41 /// MSAA sample count of the source.
42 pub sample_count: u32,
43}