Files
metal2vulkan/src/as_shadow.rs
T
Anees Iqbal 8b78eaca3b Expand macOS 26 AIR translation coverage
Overhaul the validation workflow around sharded authored cases, dependency-exact observations, incremental indexed corpus audits, bounded parallel translation, and native Metal/Vulkan comparison.\n\nExpand native AIR lowering, reflection, linked-function specialization, resource and stage-interface support, and structural CFG/pointer repair across the harvested macOS 26 corpus. Add exact intrinsic inventory, distributed 16x16x16 matrix lowering, explicit opaque tensor linkage, and regression coverage for the newly supported feature classes.\n\nThe final corpus verification accounts for all 88,819 indexed AIR modules under the current product fingerprint: 65,355 translate and validate directly, 23,464 require exact authored linkage, and zero fail or remain unresolved.
2026-08-13 21:46:27 +02:00

32 lines
1.4 KiB
Rust

//! Host-populated metadata view for AIR acceleration-structure introspection.
//!
//! Vulkan acceleration-structure descriptors are opaque: shaders cannot ask one for its instance
//! count or enumerate child references. AIR exposes both operations, so the host binds this narrow
//! StorageBuffer shadow at the Metal acceleration-structure resource location whenever a kernel uses
//! those intrinsics. Child references are the serialized 64-bit pointer payloads used by the rest of
//! the AIR BVH ABI.
/// Fixed header preceding the child-reference array.
#[repr(C)]
pub struct AccelerationStructureShadowHeader {
pub instance_count: u32,
pub reserved: u32,
}
pub const INSTANCE_COUNT_BYTE_OFFSET: u64 =
std::mem::offset_of!(AccelerationStructureShadowHeader, instance_count) as u64;
pub const CHILD_REFERENCES_BYTE_OFFSET: u64 =
std::mem::size_of::<AccelerationStructureShadowHeader>() as u64;
pub const CHILD_REFERENCE_BYTE_STRIDE: u64 = std::mem::size_of::<u64>() as u64;
/// Fixed header preceding tightly packed primitive triangle vertices.
#[repr(C)]
pub struct PrimitiveAccelerationStructureShadowHeader {
pub triangle_count: u32,
pub reserved: u32,
}
pub const PRIMITIVE_TRIANGLES_BYTE_OFFSET: u64 =
std::mem::size_of::<PrimitiveAccelerationStructureShadowHeader>() as u64;
pub const PRIMITIVE_TRIANGLE_BYTE_STRIDE: u64 = 9 * std::mem::size_of::<f32>() as u64;