use core::mem::offset_of;
pub const TAG_DONE: u32 = 0;
pub const TAG_EXTEND: u32 = 1;
pub const TAG_SCATTER: u32 = 2;
pub const TAG_SURFACE: u32 = 3;
pub const TAG_ARM_BASE: u32 = 3;
pub const TAG_SPLIT: u32 = 9;
pub const TAG_TAIL: u32 = 10;
pub const TAG_FINALIZE: u32 = 11;
pub const TAG_NEE_HG: u32 = 12;
pub const ARM_FROSTED: u32 = 1;
pub const ARM_TIR: u32 = 2;
pub const ARM_UNI_ENTRY: u32 = 3;
pub const ARM_UNI_INTERNAL: u32 = 4;
pub const ARM_GENERIC: u32 = 5;
pub const PHASE_NEXT: u32 = 0;
pub const PHASE_END_STEP: u32 = 1;
pub const PHASE_TERMINATE: u32 = 2;
pub const FLAG_INSIDE_GEM: u32 = 1;
pub const FLAG_IS_EXTRAORDINARY: u32 = 2;
pub const FLAG_HAVE_PREV_PLANE_NORMAL: u32 = 4;
pub const FLAG_PATH_ESCAPED: u32 = 8;
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, bytemuck::Pod, bytemuck::Zeroable)]
pub struct EwParams {
pub chunk_rays: u32,
pub bounce: u32,
pub finalize_all: u32,
pub has_scatter: u32,
pub pad0: u32,
pub pad1: u32,
pub pad2: u32,
pub pad3: u32,
}
const _: () = {
assert!(size_of::<EwParams>() == 32);
assert!(offset_of!(EwParams, chunk_rays) == 0);
assert!(offset_of!(EwParams, bounce) == 4);
assert!(offset_of!(EwParams, finalize_all) == 8);
assert!(offset_of!(EwParams, has_scatter) == 12);
assert!(offset_of!(EwParams, pad0) == 16);
assert!(offset_of!(EwParams, pad1) == 20);
assert!(offset_of!(EwParams, pad2) == 24);
assert!(offset_of!(EwParams, pad3) == 28);
};
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, bytemuck::Pod, bytemuck::Zeroable)]
pub struct EwRayCore {
pub origin: [f32; 4],
pub dir: [f32; 4],
pub k: [f32; 4],
pub prev_plane_normal: [f32; 4],
pub pending_mis_dir: [f32; 4],
pub nee_xyz: [f32; 4],
pub observer: [f32; 4],
pub ray_meta: [u32; 4],
}
const _: () = {
assert!(size_of::<EwRayCore>() == 128);
assert!(offset_of!(EwRayCore, origin) == 0);
assert!(offset_of!(EwRayCore, dir) == 16);
assert!(offset_of!(EwRayCore, k) == 32);
assert!(offset_of!(EwRayCore, prev_plane_normal) == 48);
assert!(offset_of!(EwRayCore, pending_mis_dir) == 64);
assert!(offset_of!(EwRayCore, nee_xyz) == 80);
assert!(offset_of!(EwRayCore, observer) == 96);
assert!(offset_of!(EwRayCore, ray_meta) == 112);
};
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, bytemuck::Pod, bytemuck::Zeroable)]
pub struct EwRayChan {
pub stokes: [[f32; 4]; 8],
pub radiance: [f32; 8],
pub path_pdf: [f32; 8],
pub split_radiance: [f32; 8],
pub lambdas: [f32; 8],
pub compat: [u32; 8],
}
const _: () = {
assert!(size_of::<EwRayChan>() == 288);
assert!(offset_of!(EwRayChan, stokes) == 0);
assert!(offset_of!(EwRayChan, radiance) == 128);
assert!(offset_of!(EwRayChan, path_pdf) == 160);
assert!(offset_of!(EwRayChan, split_radiance) == 192);
assert!(offset_of!(EwRayChan, lambdas) == 224);
assert!(offset_of!(EwRayChan, compat) == 256);
};
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, bytemuck::Pod, bytemuck::Zeroable)]
pub struct EwHit {
pub hit_point: [f32; 4],
pub hit_normal: [f32; 4],
pub shading_normal: [f32; 4],
pub wave_dir_at_bounce: [f32; 4],
pub phase_dir_this_check: [f32; 4],
pub misc: [u32; 4],
pub split: [u32; 4],
pub split_dir: [[f32; 4]; 8],
}
const _: () = {
assert!(size_of::<EwHit>() == 240);
assert!(offset_of!(EwHit, hit_point) == 0);
assert!(offset_of!(EwHit, hit_normal) == 16);
assert!(offset_of!(EwHit, shading_normal) == 32);
assert!(offset_of!(EwHit, wave_dir_at_bounce) == 48);
assert!(offset_of!(EwHit, phase_dir_this_check) == 64);
assert!(offset_of!(EwHit, misc) == 80);
assert!(offset_of!(EwHit, split) == 96);
assert!(offset_of!(EwHit, split_dir) == 112);
};
include!(concat!(env!("OUT_DIR"), "/ew_kernel_set_hash.rs"));