#[derive(Copy, Clone, bytemuck::NoUninit)]
#[repr(C)]
pub struct DecalView {
pub vp: [[f32; 4]; 4],
pub inv_vp: [[f32; 4]; 4],
pub viewport: [f32; 2],
pub _pad: [f32; 2],
}
#[derive(Copy, Clone, bytemuck::NoUninit)]
#[repr(C)]
pub struct DecalParams {
pub model: [[f32; 4]; 4],
pub inv_model: [[f32; 4]; 4],
pub tint: [f32; 4],
pub fade_pow: f32,
pub _pad0: f32,
pub _pad1: f32,
pub _pad2: f32,
}
#[derive(Copy, Clone, bytemuck::NoUninit)]
#[repr(C)]
pub struct LineView {
pub vp: [[f32; 4]; 4],
pub occluded_alpha: f32,
pub _pad: [f32; 3],
}
#[derive(Copy, Clone, bytemuck::NoUninit)]
#[repr(C)]
pub struct ParticleView {
pub vp: [[f32; 4]; 4],
pub cam_right: [f32; 3],
pub _pad0: f32,
pub cam_up: [f32; 3],
pub _pad1: f32,
}
#[derive(Copy, Clone, Default)]
#[repr(C)]
pub struct GpuParticle {
pub position: [f32; 3],
pub age: f32,
pub velocity: [f32; 3],
pub lifetime: f32,
}
#[repr(C)]
#[derive(Clone, Copy, bytemuck::NoUninit)]
pub struct SkinParams {
pub vertex_base: u32,
pub vertex_count: u32,
pub joint_count: u32,
pub target_count: u32,
}
#[repr(C)]
#[derive(Clone, Copy, bytemuck::NoUninit)]
pub struct ModelHistoryParams {
pub record_count: u32,
pub _pad: [u32; 3],
}
#[cfg(test)]
mod model_history_tests {
use super::*;
use core::mem::{offset_of, size_of};
#[test]
fn model_history_params_layout_matches_the_shader() {
assert_eq!(size_of::<ModelHistoryParams>(), 16);
assert_eq!(offset_of!(ModelHistoryParams, record_count), 0);
assert_eq!(offset_of!(ModelHistoryParams, _pad), 4);
}
}