#[repr(C)]pub struct GpuObjectData {Show 13 fields
pub model: [[f32; 4]; 4],
pub tint: [f32; 3],
pub roughness: f32,
pub emissive: [f32; 3],
pub metallic: f32,
pub albedo_index: u32,
pub normal_index: u32,
pub emissive_map_index: u32,
pub orm_map_index: u32,
pub bb_min: [f32; 3],
pub cull_distance: f32,
pub bb_max: [f32; 3],
pub alpha_cutoff: f32,
}Expand description
Per-object record consumed by the Metal “bindless” static main pass.
The static pipeline no longer rebinds model/material/textures per draw
call: every object’s transform, material scalars, and texture-pool indices
live in one GPU buffer, and the vertex/fragment shaders index it by the
object id delivered through [[base_instance]]. That makes each draw call
stateless, which is the prerequisite for the GPU-driven compute-cull +
indirect-command-buffer pass.
The renderer rebuilds the buffer each frame from its DrawObject list, so
update_model / update_visibility changes are picked up automatically.
bb_min / bb_max / cull_distance mirror the DrawObject AABB and are
unused by the main-pass shaders; they are carried so a GPU-driven compute
cull kernel can read object bounds straight from this buffer without a
layout change.
Layout (144 bytes) must stay in sync with the shader-side record, declared
once in shaders/object_common.slang and spliced into every pass that
strides the buffer; shader_layout in concinnity-device pins this struct
against slangc’s reflection of it on every target.
albedo_index / normal_index (and the emissive / ORM indices)
are indices into each backend’s single handle-indexed texture pool: albedo,
normal, and every optional map share one dense table, so a texture used in
more than one role resolves to one descriptor. The pool’s two fallbacks
occupy reserved slots past the real textures: an object with no normal map
addresses the flat-normal entry and one with no albedo addresses the white
entry, so neither index needs a shader branch.
Fields§
§model: [[f32; 4]; 4]Column-major model-to-world matrix.
tint: [f32; 3]Linear-space RGB multiplier on the albedo sample.
roughness: f32Perceptual roughness [0, 1].
emissive: [f32; 3]Additive emission colour in linear space.
metallic: f32Metallic factor [0, 1].
albedo_index: u32Index into the bindless texture pool for this object’s albedo map.
normal_index: u32Index into the bindless texture pool for this object’s normal map.
emissive_map_index: u32Bindless-pool index for the emissive map (0 = none). Mirrors
MaterialUniforms::emissive_map_index.
orm_map_index: u32Bindless-pool index for the packed occlusion/roughness/metalness map
(0 = none). Mirrors MaterialUniforms::orm_map_index.
bb_min: [f32; 3]World-space AABB minimum (compute-cull bounds input).
cull_distance: f32View-distance cutoff; 0 = no cutoff (compute-cull bounds input).
bb_max: [f32; 3]World-space AABB maximum (compute-cull bounds input).
alpha_cutoff: f32Alpha-cutout threshold in [0, 1]; 0 disables the test. Mirrors
MaterialUniforms::alpha_cutoff.
Trait Implementations§
Source§impl Clone for GpuObjectData
impl Clone for GpuObjectData
Source§fn clone(&self) -> GpuObjectData
fn clone(&self) -> GpuObjectData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GpuObjectData
impl NoUninit for GpuObjectData
Auto Trait Implementations§
impl Freeze for GpuObjectData
impl RefUnwindSafe for GpuObjectData
impl Send for GpuObjectData
impl Sync for GpuObjectData
impl Unpin for GpuObjectData
impl UnsafeUnpin for GpuObjectData
impl UnwindSafe for GpuObjectData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more