pub struct CullSubmission<'a> {
pub instance_aabbs: &'a Buffer,
pub instance_count: u32,
pub batch_meta: &'a Buffer,
pub batch_count: u32,
pub counter: &'a Buffer,
pub visible_out: &'a Buffer,
pub indirect_out: &'a Buffer,
pub shadow_pass: bool,
}Expand description
Inputs to one cull dispatch.
Buffer requirements:
instance_aabbs:STORAGE.instance_countxInstanceAabb.batch_meta:STORAGE.batch_countxBatchMeta.counter:STORAGE.batch_countxu32, used as atomic counters. The renderer zeroes this slot before the dispatch.visible_out:STORAGE. Holds up toinstance_countxu32, the compacted list of visible instance indices written by the cull pass.indirect_out:STORAGE | INDIRECT.batch_countxDrawIndexedIndirect(20 bytes per entry). The static fields (index_count,first_index,base_vertex,first_instance) come from the matchingBatchMetaentry;instance_countis overwritten by the cull pass.
After the encoder runs, draw each batch with
pass.draw_indexed_indirect(indirect_out, batch_idx * 20) using
visible_out as the per-instance lookup buffer.
Fields§
§instance_aabbs: &'a BufferStorage buffer of InstanceAabb entries.
instance_count: u32Number of valid entries in instance_aabbs (not the buffer capacity).
batch_meta: &'a BufferStorage buffer of BatchMeta entries, one per batch.
batch_count: u32Number of valid entries in batch_meta.
counter: &'a BufferStorage buffer used for per-batch atomic counters. Must hold at
least batch_count u32 slots. The cull pass zeroes the counters at
the end of its dispatch so the same buffer can be reused across
cascades or frames.
visible_out: &'a BufferStorage buffer that receives the compacted list of visible instance
indices. Sized for at least instance_count u32 slots.
indirect_out: &'a BufferStorage / indirect buffer that receives one DrawIndexedIndirect
entry per batch (20 bytes each).
shadow_pass: booltrue to run the shadow-cull variant on the main camera pass: the
cull shader honours InstanceAabb::cast_shadows and skips entries
with the flag clear. submit_cull_shadow forces this on regardless
of the value here.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CullSubmission<'a>
impl<'a> !UnwindSafe for CullSubmission<'a>
impl<'a> Freeze for CullSubmission<'a>
impl<'a> Send for CullSubmission<'a>
impl<'a> Sync for CullSubmission<'a>
impl<'a> Unpin for CullSubmission<'a>
impl<'a> UnsafeUnpin for CullSubmission<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.