pub struct FieldSystemGpu {
pub fields: Vec<SingleFieldGpu>,
pub params_buffer: Buffer,
pub field_count: usize,
pub merge_pipeline: ComputePipeline,
pub merge_bind_group_layout: BindGroupLayout,
pub blur_decay_pipeline: ComputePipeline,
pub blur_decay_bind_group_layout: BindGroupLayout,
pub clear_pipeline: ComputePipeline,
pub clear_bind_group_layout: BindGroupLayout,
}Expand description
GPU state for all fields in a simulation.
Fields§
§fields: Vec<SingleFieldGpu>Individual field GPU states
params_buffer: BufferParameters buffer (storage buffer with array of FieldParams)
field_count: usizeNumber of fields
merge_pipeline: ComputePipelineMerge pipeline (atomic writes → float field)
merge_bind_group_layout: BindGroupLayout§blur_decay_pipeline: ComputePipelineBlur/decay pipeline
blur_decay_bind_group_layout: BindGroupLayout§clear_pipeline: ComputePipelineClear pipeline (reset atomic buffers to zero)
clear_bind_group_layout: BindGroupLayoutImplementations§
Source§impl FieldSystemGpu
impl FieldSystemGpu
pub fn new(device: &Device, registry: &FieldRegistry) -> Self
Sourcepub fn process(
&mut self,
device: &Device,
encoder: &mut CommandEncoder,
_queue: &Queue,
time: f32,
delta_time: f32,
)
pub fn process( &mut self, device: &Device, encoder: &mut CommandEncoder, _queue: &Queue, time: f32, delta_time: f32, )
Run field processing: merge deposits, blur/decay or custom update, clear write buffer
If a field has custom_update code, it replaces the blur/decay step with the custom shader.
Sourcepub fn create_particle_bind_group(
&self,
device: &Device,
layout: &BindGroupLayout,
) -> Option<BindGroup>
pub fn create_particle_bind_group( &self, device: &Device, layout: &BindGroupLayout, ) -> Option<BindGroup>
Create bind group for particle compute shader access
Auto Trait Implementations§
impl Freeze for FieldSystemGpu
impl !RefUnwindSafe for FieldSystemGpu
impl Send for FieldSystemGpu
impl Sync for FieldSystemGpu
impl Unpin for FieldSystemGpu
impl !UnwindSafe for FieldSystemGpu
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
Mutably borrows from an owned value. Read more
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.