pub struct Demand {
pub buffers: Vec<Alloc>,
pub texture: Option<(u32, u32)>,
pub passes: Vec<PassBindings>,
}Expand description
Allocations and passes a model would produce for one set of params.
Reduction intermediates and the engine’s own index and scan passes are left out: both are fixed rather than declared, and both are negligible next to what they sit beside.
Fields§
§buffers: Vec<Alloc>Buffers the model would allocate.
texture: Option<(u32, u32)>Size of the display texture, already capped by crate::display_scale.
passes: Vec<PassBindings>Storage bindings of each pass.
Implementations§
Source§impl Demand
impl Demand
Sourcepub fn push_sides(&mut self, label: &str, words: usize, doubled: bool)
pub fn push_sides(&mut self, label: &str, words: usize, doubled: bool)
Records side _a of buffer label, and side _b as well when doubled is set.
Sourcepub fn push_index(&mut self, label: &str, n_cells: u32, num_agents: u32)
pub fn push_index(&mut self, label: &str, n_cells: u32, num_agents: u32)
Records the five tables a GpuSpatialHash of n_cells cells rebuilds every
tick for num_agents agents.
Sourcepub fn set_display(&mut self, width: u32, height: u32, limits: &Limits)
pub fn set_display(&mut self, width: u32, height: u32, limits: &Limits)
Records the display texture of a width by height grid, capped for limits as the engine would create it.
Sourcepub fn push_pass(&mut self, label: String, storage: u32)
pub fn push_pass(&mut self, label: String, storage: u32)
Records pass label, binding storage storage buffers.
Sourcepub fn shortfalls(&self, limits: &Limits) -> Vec<String>
pub fn shortfalls(&self, limits: &Limits) -> Vec<String>
Returns the reasons limits cannot host the model, empty when it can.
Buffers of one size share a line. A ping-ponged buffer’s two sides would otherwise say the same sentence twice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Demand
impl RefUnwindSafe for Demand
impl Send for Demand
impl Sync for Demand
impl Unpin for Demand
impl UnsafeUnpin for Demand
impl UnwindSafe for Demand
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
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