pub(crate) struct Draw {
module: Box<dyn DynShaderModule>,
metadata_bind_group_layout: Box<dyn DynBindGroupLayout>,
src_bind_group_layout: Box<dyn DynBindGroupLayout>,
dst_bind_group_layout: Box<dyn DynBindGroupLayout>,
pipeline_layout: Box<dyn DynPipelineLayout>,
pipeline: Box<dyn DynComputePipeline>,
free_indirect_entries: Mutex<Vec<BufferPoolEntry>>,
free_metadata_entries: Mutex<Vec<BufferPoolEntry>>,
}
Expand description
Holds all device-level resources that are needed to validate indirect draws.
This machinery requires the following limits:
- max_bind_groups: 3,
- max_dynamic_storage_buffers_per_pipeline_layout: 1,
- max_storage_buffers_per_shader_stage: 3,
- max_push_constant_size: 8,
These are all indirectly satisfied by DownlevelFlags::INDIRECT_EXECUTION
, which is also
required for this module’s functionality to work.
Fields§
§module: Box<dyn DynShaderModule>
§metadata_bind_group_layout: Box<dyn DynBindGroupLayout>
§src_bind_group_layout: Box<dyn DynBindGroupLayout>
§dst_bind_group_layout: Box<dyn DynBindGroupLayout>
§pipeline_layout: Box<dyn DynPipelineLayout>
§pipeline: Box<dyn DynComputePipeline>
§free_indirect_entries: Mutex<Vec<BufferPoolEntry>>
§free_metadata_entries: Mutex<Vec<BufferPoolEntry>>
Implementations§
Source§impl Draw
impl Draw
pub(super) fn new( device: &dyn DynDevice, required_features: &Features, ) -> Result<Self, CreateIndirectValidationPipelineError>
Sourcepub(super) fn create_src_bind_group(
&self,
device: &dyn DynDevice,
limits: &Limits,
buffer_size: u64,
buffer: &dyn DynBuffer,
) -> Result<Option<Box<dyn DynBindGroup>>, DeviceError>
pub(super) fn create_src_bind_group( &self, device: &dyn DynDevice, limits: &Limits, buffer_size: u64, buffer: &dyn DynBuffer, ) -> Result<Option<Box<dyn DynBindGroup>>, DeviceError>
Ok(None)
will only be returned if buffer_size
is 0
.
fn acquire_dst_entry( &self, device: &dyn DynDevice, ) -> Result<BufferPoolEntry, DeviceError>
fn release_dst_entries(&self, entries: impl Iterator<Item = BufferPoolEntry>)
fn acquire_metadata_entry( &self, device: &dyn DynDevice, ) -> Result<BufferPoolEntry, DeviceError>
fn release_metadata_entries( &self, entries: impl Iterator<Item = BufferPoolEntry>, )
Sourcepub(crate) fn inject_validation_pass(
&self,
device: &Arc<Device>,
snatch_guard: &SnatchGuard<'_>,
resources: &mut DrawResources,
temp_resources: &mut Vec<TempResource>,
encoder: &mut dyn DynCommandEncoder,
batcher: DrawBatcher,
) -> Result<(), DeviceError>
pub(crate) fn inject_validation_pass( &self, device: &Arc<Device>, snatch_guard: &SnatchGuard<'_>, resources: &mut DrawResources, temp_resources: &mut Vec<TempResource>, encoder: &mut dyn DynCommandEncoder, batcher: DrawBatcher, ) -> Result<(), DeviceError>
Injects a compute pass that will validate all indirect draws in the current render pass.
pub(super) fn dispose(self, device: &dyn DynDevice)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Draw
impl !RefUnwindSafe for Draw
impl Send for Draw
impl Sync for Draw
impl Unpin for Draw
impl !UnwindSafe for Draw
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