/// Pushes descriptor data directly into the command buffer for future dispatch or draw calls.
///
/// # Panics
///
/// - Panics if the queue family of the command buffer does not support `pipeline_bind_point`.
/// - Panics if the
///   [`khr_push_descriptor`](crate::device::DeviceExtensions::khr_push_descriptor)
///   extension is not enabled on the device.
/// - Panics if `set_num` is not less than the number of sets in `pipeline_layout`.
/// - Panics if an element of `descriptor_writes` is not compatible with `pipeline_layout`.
Pushes descriptor data directly into the command buffer for future dispatch or draw calls.
Pushes descriptor data directly into the command buffer for future dispatch or draw calls .
pub fn push_descriptor_set(
        &mut self,
        pipeline_bind_point: PipelineBindPoint,
        pipeline_layout: Arc<PipelineLayout>,
        set_num: u32,
        descriptor_writes: impl IntoIterator<Item = WriteDescriptorSet>,
    ) -> &mut Self {
        match pipeline_bind_point {
            PipelineBindPoint::Compute => assert!(
                self.queue_family().supports_compute(),
                "the queue family of the command buffer must support compute operations"
            ),
            PipelineBindPoint::Graphics => assert!(
                self.queue_family().supports_graphics(),
                "the queue family of the command buffer must support graphics operations"
            ),
        }
        assert!(
            self.device().enabled_extensions().khr_push_descriptor,
            "the khr_push_descriptor extension must be enabled on the device"
        );
        assert!(
            set_num as usize <= pipeline_layout.descriptor_set_layouts().len(),
            "the descriptor set slot being bound must be less than the number of sets in pipeline_layout"
        );
        let descriptor_writes: SmallVec<[_; 8]> = descriptor_writes.into_iter().collect();
        let descriptor_set_layout = &pipeline_layout.descriptor_set_layouts()[set_num as usize];
        for write in &descriptor_writes {
            check_descriptor_write(write, descriptor_set_layout, 0).unwrap();
        }
        unsafe {
            self.inner.push_descriptor_set(
                pipeline_bind_point,
                pipeline_layout,
                set_num,
                descriptor_writes,
            );
        }
        self
    }
pub fn push_descriptor_set ( & mut self , pipeline_bind_point : PipelineBindPoint , pipeline_layout : Arc < PipelineLayout > , set_num : u32 , descriptor_writes : impl IntoIterator < Item = WriteDescriptorSet > , ) -> & mut Self { match pipeline_bind_point { PipelineBindPoint :: Compute => assert ! ( self queue_family ( ) supports_compute ( ) " " ) , PipelineBindPoint :: Graphics => assert ! ( self queue_family ( ) supports_graphics ( ) " " ) , } assert ! ( self device ( ) enabled_extensions ( ) khr_push_descriptor " " ) ; assert ! ( set_num as usize pipeline_layout descriptor_set_layouts ( ) len ( ) " " ) ; let descriptor_writes : SmallVec < [ _ ; 8 ] > = descriptor_writes . into_iter ( ) . collect ( ) ; let descriptor_set_layout = & pipeline_layout . descriptor_set_layouts ( ) [ set_num as usize ] ; for write in & descriptor_writes { check_descriptor_write ( write , descriptor_set_layout , 0 ) . unwrap ( ) ; } unsafe { self . inner . push_descriptor_set ( pipeline_bind_point , pipeline_layout , set_num , descriptor_writes , ) ; } self }
Pushes descriptor data directly into the command buffer for future dispatch or draw calls.
Pushes descriptor data directly into the command buffer for future dispatch or draw calls .
&mut self
pipeline_bind_point
PipelineBindPoint
pipeline_layout
Arc<PipelineLayout>
set_num
u32
descriptor_writes
impl IntoIterator<Item = WriteDescriptorSet>
panics
Panics if the queue family of the command buffer does not support `pipeline_bind_point`.
Panics if the
[`khr_push_descriptor`](crate::device::DeviceExtensions::khr_push_descriptor)
extension is not enabled on the device.
Panics if `set_num` is not less than the number of sets in `pipeline_layout`.
Panics if an element of `descriptor_writes` is not compatible with `pipeline_layout`.
Panics if the queue family of the command buffer does not support ` pipeline_bind_point ` . Panics if the [ ` khr_push_descriptor ` ] ( crate :: device :: DeviceExtensions :: khr_push_descriptor ) extension is not enabled on the device . Panics if ` set_num ` is not less than the number of sets in ` pipeline_layout ` . Panics if an element of ` descriptor_writes ` is not compatible with ` pipeline_layout ` .