#[derive(Copy, Clone)]
#[repr(C)]
pub struct CullParams {
pub planes: [[f32; 4]; 6],
pub cam_pos: [f32; 3],
pub object_count: u32,
pub prev_view_proj: [[f32; 4]; 4],
pub hiz_size: [f32; 2],
pub hiz_mip_count: u32,
pub hiz_enabled: u32,
pub bucket_count: u32,
pub bucket_stride: u32,
pub _pad: [u32; 2],
}
#[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>(), 208);
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, prev_view_proj), 112);
assert_eq!(offset_of!(CullParams, hiz_size), 176);
assert_eq!(offset_of!(CullParams, hiz_mip_count), 184);
assert_eq!(offset_of!(CullParams, hiz_enabled), 188);
assert_eq!(offset_of!(CullParams, bucket_count), 192);
assert_eq!(offset_of!(CullParams, bucket_stride), 196);
}
}