pub const AUTO_EXPOSURE_PUSH_BYTES: u32 = 16;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct CullParams {
pub planes: [[f32; 4]; 6],
pub cam_pos: [f32; 3],
pub object_count: u32,
pub bucket_count: u32,
pub bucket_stride: u32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct CullHizParams {
pub prev_view_proj: [[f32; 4]; 4],
pub hiz_size: [f32; 2],
pub hiz_mip_count: u32,
pub hiz_enabled: u32,
}
#[cfg(test)]
mod tests {
use super::*;
use core::mem::{offset_of, size_of};
#[test]
fn cull_params_layout_matches_the_shader() {
assert_eq!(size_of::<CullParams>(), 120);
assert_eq!(offset_of!(CullParams, planes), 0);
assert_eq!(offset_of!(CullParams, cam_pos), 96);
assert_eq!(offset_of!(CullParams, object_count), 108);
assert_eq!(offset_of!(CullParams, bucket_count), 112);
assert_eq!(offset_of!(CullParams, bucket_stride), 116);
}
#[test]
fn cull_hiz_params_layout_matches_the_shader() {
assert_eq!(size_of::<CullHizParams>(), 80);
assert_eq!(offset_of!(CullHizParams, prev_view_proj), 0);
assert_eq!(offset_of!(CullHizParams, hiz_size), 64);
assert_eq!(offset_of!(CullHizParams, hiz_mip_count), 72);
assert_eq!(offset_of!(CullHizParams, hiz_enabled), 76);
}
}