Struct gfx_hal::command::CommandBuffer
source · pub struct CommandBuffer<B: Backend, C, S = OneShot, L = Primary, R = <B as Backend>::CommandBuffer> { /* private fields */ }Expand description
A strongly-typed command buffer that will only implement methods that are valid for the operations it supports.
Implementations
sourceimpl<B: Backend, C: Supports<Compute>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
impl<B: Backend, C: Supports<Compute>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
sourcepub unsafe fn bind_compute_pipeline(&mut self, pipeline: &B::ComputePipeline)
pub unsafe fn bind_compute_pipeline(&mut self, pipeline: &B::ComputePipeline)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn bind_compute_descriptor_sets<I, J>(
&mut self,
layout: &B::PipelineLayout,
first_set: usize,
sets: I,
offsets: J
)where
I: IntoIterator,
I::Item: Borrow<B::DescriptorSet>,
J: IntoIterator,
J::Item: Borrow<DescriptorSetOffset>,
pub unsafe fn bind_compute_descriptor_sets<I, J>(
&mut self,
layout: &B::PipelineLayout,
first_set: usize,
sets: I,
offsets: J
)where
I: IntoIterator,
I::Item: Borrow<B::DescriptorSet>,
J: IntoIterator,
J::Item: Borrow<DescriptorSetOffset>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn dispatch(&mut self, count: WorkGroupCount)
pub unsafe fn dispatch(&mut self, count: WorkGroupCount)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn dispatch_indirect(&mut self, buffer: &B::Buffer, offset: Offset)
pub unsafe fn dispatch_indirect(&mut self, buffer: &B::Buffer, offset: Offset)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn push_compute_constants(
&mut self,
layout: &B::PipelineLayout,
offset: u32,
constants: &[u32]
)
pub unsafe fn push_compute_constants(
&mut self,
layout: &B::PipelineLayout,
offset: u32,
constants: &[u32]
)
Identical to the RawCommandBuffer method of the same name.
sourceimpl<B: Backend, C: Supports<Graphics>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
impl<B: Backend, C: Supports<Graphics>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
sourcepub unsafe fn clear_image<T>(
&mut self,
image: &B::Image,
layout: Layout,
color: ClearColor,
depth_stencil: ClearDepthStencil,
subresource_ranges: T
)where
T: IntoIterator,
T::Item: Borrow<SubresourceRange>,
pub unsafe fn clear_image<T>(
&mut self,
image: &B::Image,
layout: Layout,
color: ClearColor,
depth_stencil: ClearDepthStencil,
subresource_ranges: T
)where
T: IntoIterator,
T::Item: Borrow<SubresourceRange>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn bind_index_buffer(&mut self, ibv: IndexBufferView<'_, B>)
pub unsafe fn bind_index_buffer(&mut self, ibv: IndexBufferView<'_, B>)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn bind_vertex_buffers<I, T>(&mut self, first_binding: u32, buffers: I)where
I: IntoIterator<Item = (T, Offset)>,
T: Borrow<B::Buffer>,
pub unsafe fn bind_vertex_buffers<I, T>(&mut self, first_binding: u32, buffers: I)where
I: IntoIterator<Item = (T, Offset)>,
T: Borrow<B::Buffer>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn bind_graphics_pipeline(&mut self, pipeline: &B::GraphicsPipeline)
pub unsafe fn bind_graphics_pipeline(&mut self, pipeline: &B::GraphicsPipeline)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn bind_graphics_descriptor_sets<I, J>(
&mut self,
layout: &B::PipelineLayout,
first_set: usize,
sets: I,
offsets: J
)where
I: IntoIterator,
I::Item: Borrow<B::DescriptorSet>,
J: IntoIterator,
J::Item: Borrow<DescriptorSetOffset>,
pub unsafe fn bind_graphics_descriptor_sets<I, J>(
&mut self,
layout: &B::PipelineLayout,
first_set: usize,
sets: I,
offsets: J
)where
I: IntoIterator,
I::Item: Borrow<B::DescriptorSet>,
J: IntoIterator,
J::Item: Borrow<DescriptorSetOffset>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_viewports<T>(&mut self, first_viewport: u32, viewports: T)where
T: IntoIterator,
T::Item: Borrow<Viewport>,
pub unsafe fn set_viewports<T>(&mut self, first_viewport: u32, viewports: T)where
T: IntoIterator,
T::Item: Borrow<Viewport>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_scissors<T>(&mut self, first_scissor: u32, scissors: T)where
T: IntoIterator,
T::Item: Borrow<Rect>,
pub unsafe fn set_scissors<T>(&mut self, first_scissor: u32, scissors: T)where
T: IntoIterator,
T::Item: Borrow<Rect>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_stencil_reference(&mut self, faces: Face, value: StencilValue)
pub unsafe fn set_stencil_reference(&mut self, faces: Face, value: StencilValue)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_stencil_read_mask(&mut self, faces: Face, value: StencilValue)
pub unsafe fn set_stencil_read_mask(&mut self, faces: Face, value: StencilValue)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_stencil_write_mask(&mut self, faces: Face, value: StencilValue)
pub unsafe fn set_stencil_write_mask(&mut self, faces: Face, value: StencilValue)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_blend_constants(&mut self, cv: ColorValue)
pub unsafe fn set_blend_constants(&mut self, cv: ColorValue)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_depth_bounds(&mut self, bounds: Range<f32>)
pub unsafe fn set_depth_bounds(&mut self, bounds: Range<f32>)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_line_width(&mut self, width: f32)
pub unsafe fn set_line_width(&mut self, width: f32)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn set_depth_bias(&mut self, depth_bias: DepthBias)
pub unsafe fn set_depth_bias(&mut self, depth_bias: DepthBias)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn push_graphics_constants(
&mut self,
layout: &B::PipelineLayout,
stages: ShaderStageFlags,
offset: u32,
constants: &[u32]
)
pub unsafe fn push_graphics_constants(
&mut self,
layout: &B::PipelineLayout,
stages: ShaderStageFlags,
offset: u32,
constants: &[u32]
)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn resolve_image<T>(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Image,
dst_layout: Layout,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<ImageResolve>,
pub unsafe fn resolve_image<T>(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Image,
dst_layout: Layout,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<ImageResolve>,
Identical to the RawCommandBuffer method of the same name.
sourceimpl<B: Backend, C: Supports<Graphics>, S: Shot> CommandBuffer<B, C, S, Primary>
impl<B: Backend, C: Supports<Graphics>, S: Shot> CommandBuffer<B, C, S, Primary>
sourcepub unsafe fn begin_render_pass_inline<T>(
&mut self,
render_pass: &B::RenderPass,
frame_buffer: &B::Framebuffer,
render_area: Rect,
clear_values: T
) -> RenderPassInlineEncoder<'_, B>where
T: IntoIterator,
T::Item: Borrow<ClearValue>,
pub unsafe fn begin_render_pass_inline<T>(
&mut self,
render_pass: &B::RenderPass,
frame_buffer: &B::Framebuffer,
render_area: Rect,
clear_values: T
) -> RenderPassInlineEncoder<'_, B>where
T: IntoIterator,
T::Item: Borrow<ClearValue>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn begin_render_pass_secondary<T>(
&mut self,
render_pass: &B::RenderPass,
frame_buffer: &B::Framebuffer,
render_area: Rect,
clear_values: T
) -> RenderPassSecondaryEncoder<'_, B>where
T: IntoIterator,
T::Item: Borrow<ClearValue>,
pub unsafe fn begin_render_pass_secondary<T>(
&mut self,
render_pass: &B::RenderPass,
frame_buffer: &B::Framebuffer,
render_area: Rect,
clear_values: T
) -> RenderPassSecondaryEncoder<'_, B>where
T: IntoIterator,
T::Item: Borrow<ClearValue>,
Creates a new secondary render pass.
sourceimpl<B: Backend, C: Supports<GraphicsOrCompute>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
impl<B: Backend, C: Supports<GraphicsOrCompute>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
sourcepub unsafe fn begin_query(&mut self, query: Query<'_, B>, flags: ControlFlags)
pub unsafe fn begin_query(&mut self, query: Query<'_, B>, flags: ControlFlags)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn end_query(&mut self, query: Query<'_, B>)
pub unsafe fn end_query(&mut self, query: Query<'_, B>)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn reset_query_pool(&mut self, pool: &B::QueryPool, queries: Range<Id>)
pub unsafe fn reset_query_pool(&mut self, pool: &B::QueryPool, queries: Range<Id>)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn copy_query_pool_results(
&mut self,
pool: &B::QueryPool,
queries: Range<Id>,
buffer: &B::Buffer,
offset: Offset,
stride: Offset,
flags: ResultFlags
)
pub unsafe fn copy_query_pool_results(
&mut self,
pool: &B::QueryPool,
queries: Range<Id>,
buffer: &B::Buffer,
offset: Offset,
stride: Offset,
flags: ResultFlags
)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn write_timestamp(
&mut self,
stage: PipelineStage,
query: Query<'_, B>
)
pub unsafe fn write_timestamp(
&mut self,
stage: PipelineStage,
query: Query<'_, B>
)
Identical to the RawCommandBuffer method of the same name.
sourceimpl<B: Backend, C: Supports<Transfer>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
impl<B: Backend, C: Supports<Transfer>, S: Shot, L: Level> CommandBuffer<B, C, S, L>
sourcepub unsafe fn pipeline_barrier<'i, T>(
&mut self,
stages: Range<PipelineStage>,
dependencies: Dependencies,
barriers: T
)where
T: IntoIterator,
T::Item: Borrow<Barrier<'i, B>>,
pub unsafe fn pipeline_barrier<'i, T>(
&mut self,
stages: Range<PipelineStage>,
dependencies: Dependencies,
barriers: T
)where
T: IntoIterator,
T::Item: Borrow<Barrier<'i, B>>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn fill_buffer<R>(&mut self, buffer: &B::Buffer, range: R, data: u32)where
R: RangeArg<Offset>,
pub unsafe fn fill_buffer<R>(&mut self, buffer: &B::Buffer, range: R, data: u32)where
R: RangeArg<Offset>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn copy_buffer<T>(
&mut self,
src: &B::Buffer,
dst: &B::Buffer,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<BufferCopy>,
pub unsafe fn copy_buffer<T>(
&mut self,
src: &B::Buffer,
dst: &B::Buffer,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<BufferCopy>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn update_buffer(
&mut self,
buffer: &B::Buffer,
offset: Offset,
data: &[u8]
)
pub unsafe fn update_buffer(
&mut self,
buffer: &B::Buffer,
offset: Offset,
data: &[u8]
)
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn copy_image<T>(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Image,
dst_layout: Layout,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<ImageCopy>,
pub unsafe fn copy_image<T>(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Image,
dst_layout: Layout,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<ImageCopy>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn copy_buffer_to_image<T>(
&mut self,
src: &B::Buffer,
dst: &B::Image,
dst_layout: Layout,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<BufferImageCopy>,
pub unsafe fn copy_buffer_to_image<T>(
&mut self,
src: &B::Buffer,
dst: &B::Image,
dst_layout: Layout,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<BufferImageCopy>,
Identical to the RawCommandBuffer method of the same name.
sourcepub unsafe fn copy_image_to_buffer<T>(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Buffer,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<BufferImageCopy>,
pub unsafe fn copy_image_to_buffer<T>(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Buffer,
regions: T
)where
T: IntoIterator,
T::Item: Borrow<BufferImageCopy>,
Identical to the RawCommandBuffer method of the same name.
sourceimpl<B: Backend, C> CommandBuffer<B, C, OneShot, Primary>
impl<B: Backend, C> CommandBuffer<B, C, OneShot, Primary>
sourceimpl<B: Backend, C> CommandBuffer<B, C, MultiShot, Primary>
impl<B: Backend, C> CommandBuffer<B, C, MultiShot, Primary>
sourceimpl<B: Backend, C> CommandBuffer<B, C, OneShot, Secondary>
impl<B: Backend, C> CommandBuffer<B, C, OneShot, Secondary>
sourcepub unsafe fn begin(&mut self, inheritance: CommandBufferInheritanceInfo<'_, B>)
pub unsafe fn begin(&mut self, inheritance: CommandBufferInheritanceInfo<'_, B>)
Begin recording a one-shot secondary command buffer.
sourceimpl<B: Backend, C> CommandBuffer<B, C, MultiShot, Secondary>
impl<B: Backend, C> CommandBuffer<B, C, MultiShot, Secondary>
sourcepub unsafe fn begin(
&mut self,
allow_pending_resubmit: bool,
inheritance: CommandBufferInheritanceInfo<'_, B>
)
pub unsafe fn begin(
&mut self,
allow_pending_resubmit: bool,
inheritance: CommandBufferInheritanceInfo<'_, B>
)
Begin recording a multi-shot secondary command buffer.
sourceimpl<B: Backend, C, S: Shot, L: Level> CommandBuffer<B, C, S, L>
impl<B: Backend, C, S: Shot, L: Level> CommandBuffer<B, C, S, L>
sourcepub unsafe fn new(raw: B::CommandBuffer) -> Self
pub unsafe fn new(raw: B::CommandBuffer) -> Self
Create a new typed command buffer from a raw command pool.
sourcepub unsafe fn finish(&mut self)
pub unsafe fn finish(&mut self)
Finish recording commands to the command buffers.
The command pool must be reset to able to re-record commands.
sourcepub unsafe fn downgrade<D>(&mut self) -> &mut CommandBuffer<B, D, S>where
C: Supports<D>,
pub unsafe fn downgrade<D>(&mut self) -> &mut CommandBuffer<B, D, S>where
C: Supports<D>,
Downgrade a command buffer to a lesser capability type.
sourceimpl<B: Backend, C, S: Shot> CommandBuffer<B, C, S, Primary>
impl<B: Backend, C, S: Shot> CommandBuffer<B, C, S, Primary>
sourcepub unsafe fn execute_commands<'a, I, T, K>(&mut self, cmd_buffers: I)where
K: Capability,
T: 'a + Submittable<B, K, Secondary>,
I: IntoIterator<Item = &'a T>,
C: Supports<K>,
pub unsafe fn execute_commands<'a, I, T, K>(&mut self, cmd_buffers: I)where
K: Capability,
T: 'a + Submittable<B, K, Secondary>,
I: IntoIterator<Item = &'a T>,
C: Supports<K>,
Identical to the RawCommandBuffer method of the same name.