use super::*;
#[derive(Clone, Data, Debug, PartialEq)]
pub struct RenderGraphResource3D {
#[get(type(copy))]
pub(crate) resource_id: usize,
pub(crate) name: String,
#[get(type(copy))]
pub(crate) size_bytes: usize,
#[get(type(copy))]
pub(crate) is_external_output: bool,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct RenderGraphPass3D {
#[get(type(copy))]
pub(crate) pass_id: usize,
#[get(type(copy))]
pub(crate) kind: RenderPassKind3D,
pub(crate) name: String,
pub(crate) reads: Vec<usize>,
pub(crate) writes: Vec<usize>,
#[get(type(copy))]
pub(crate) last_duration_us: u64,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct RenderGraphSchedule3D {
pub(crate) ordered_passes: Vec<usize>,
#[get(type(copy))]
pub(crate) culled_pass_count: usize,
#[get(type(copy))]
pub(crate) unaliased_bytes: usize,
#[get(type(copy))]
pub(crate) aliased_peak_bytes: usize,
pub(crate) resource_pool_slots: Vec<usize>,
}
#[derive(Clone, Data, Debug, Default)]
pub struct RenderGraph3D {
pub(crate) resources: Vec<RenderGraphResource3D>,
pub(crate) passes: Vec<RenderGraphPass3D>,
}
#[repr(C, align(16))]
#[derive(Clone, Copy, Data, Debug, Default, PartialEq)]
pub struct GpuInstanceData3D {
#[get(type(copy))]
pub(crate) model_matrix: [f32; 16],
#[get(type(copy))]
pub(crate) albedo_metallic: [f32; 4],
#[get(type(copy))]
pub(crate) emissive_roughness: [f32; 4],
#[get(type(copy))]
pub(crate) material_skin_morph_flags: [u32; 4],
}
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct GpuMeshDrawBatch3D {
#[get(type(copy))]
pub(crate) mesh_id: usize,
#[get(type(copy))]
pub(crate) lod_index: usize,
#[get(type(copy))]
pub(crate) first_instance: u32,
#[get(type(copy))]
pub(crate) instance_count: u32,
#[get(type(copy))]
pub(crate) triangles_per_instance: u32,
}
#[derive(Clone, Data, Debug, Default)]
pub struct GpuFramePacketScratch3D {
#[get(skip)]
#[get_mut(skip)]
#[set(skip)]
pub(crate) keyed_instances: Vec<(usize, usize, u32, GpuInstanceData3D)>,
pub(crate) skin_scratch: SkinPaletteScratch3D,
}
#[derive(Clone, Data, Debug)]
pub struct GpuFramePacket3D {
#[get(type(copy))]
pub(crate) view_projection: Mat4,
#[get(type(copy))]
pub(crate) prev_view_projection: Mat4,
#[get(type(copy))]
pub(crate) camera_position: Vec3,
#[get(type(copy))]
pub(crate) sun: DirectionalLight3D,
pub(crate) instances: Vec<GpuInstanceData3D>,
pub(crate) batches: Vec<GpuMeshDrawBatch3D>,
pub(crate) materials: Vec<GpuMaterialData3D>,
#[get(type(copy))]
pub(crate) csm_matrices: [Mat4; VSM_CASCADE_COUNT],
#[get(type(copy))]
pub(crate) csm_split_depths: [f32; VSM_CASCADE_COUNT],
#[get(type(copy))]
pub(crate) ibl_sh: [[f32; 3]; 9],
pub(crate) bone_matrices: Vec<Mat4>,
#[get(type(copy))]
pub(crate) use_agx_tonemap: bool,
#[get(type(copy))]
pub(crate) active_pass_count: usize,
#[get(type(copy))]
pub(crate) total_triangles: usize,
}
#[repr(C, align(16))]
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct SimdAabbBatch4 {
#[get(type(copy))]
pub(crate) min_x: [f32; 4],
#[get(type(copy))]
pub(crate) min_y: [f32; 4],
#[get(type(copy))]
pub(crate) min_z: [f32; 4],
#[get(type(copy))]
pub(crate) max_x: [f32; 4],
#[get(type(copy))]
pub(crate) max_y: [f32; 4],
#[get(type(copy))]
pub(crate) max_z: [f32; 4],
}
#[repr(C, align(16))]
#[derive(Clone, Copy, Data, Debug, Default, PartialEq)]
pub struct SimdMeshletConeBatch4 {
#[get(type(copy))]
pub(crate) center_x: [f32; 4],
#[get(type(copy))]
pub(crate) center_y: [f32; 4],
#[get(type(copy))]
pub(crate) center_z: [f32; 4],
#[get(type(copy))]
pub(crate) axis_x: [f32; 4],
#[get(type(copy))]
pub(crate) axis_y: [f32; 4],
#[get(type(copy))]
pub(crate) axis_z: [f32; 4],
#[get(type(copy))]
pub(crate) sin_alpha_sq: [f32; 4],
#[get(type(copy))]
pub(crate) extent_margin: [f32; 4],
}
#[derive(Clone, Copy, Data, Debug, Default, PartialEq)]
pub struct PbrSortEntry3D {
#[get(type(copy))]
pub(crate) sort_key: u64,
#[get(type(copy))]
pub(crate) index_start: u32,
#[get(type(copy))]
pub(crate) index_count: u32,
#[get(type(copy))]
pub(crate) base_vertex: u32,
#[get(type(copy))]
pub(crate) material_index: u32,
#[get(type(copy))]
pub(crate) pso_variant: u8,
#[get(type(copy))]
pub(crate) lod_level: u8,
#[get(type(copy))]
pub(crate) instance: GpuPbrInstance3D,
}
#[derive(Clone, Data, Debug, Default)]
pub struct GpuPbrBatcherScratch3D {
pub(crate) entries: Vec<PbrSortEntry3D>,
}
#[repr(C)]
#[derive(Clone, Copy, Data, Debug, Default, PartialEq)]
pub struct PbrSceneUniformBlock {
#[get(type(copy))]
pub(crate) view_proj: [f32; 16],
#[get(type(copy))]
pub(crate) camera_pos_exposure: [f32; 4],
#[get(type(copy))]
pub(crate) sun_dir_fog: [f32; 4],
#[get(type(copy))]
pub(crate) sun_color_ambient: [f32; 4],
#[get(type(copy))]
pub(crate) sky_horizon_tod: [f32; 4],
#[get(type(copy))]
pub(crate) sky_zenith_agx: [f32; 4],
#[get(type(copy))]
pub(crate) ibl_sh: [[f32; 4]; 9],
#[get(type(copy))]
pub(crate) batch_params: [u32; 4],
#[get(type(copy))]
pub(crate) draw_offsets: [u32; 4],
}