pub struct Encoder<'a, B: Backend, C, L> { /* private fields */ }
Expand description
Trait to encode commands outside render pass.
Implementations§
Source§impl<'a, B, C> Encoder<'a, B, C, PrimaryLevel>where
B: Backend,
impl<'a, B, C> Encoder<'a, B, C, PrimaryLevel>where
B: Backend,
Sourcepub fn begin_render_pass_inline(
&mut self,
render_pass: &B::RenderPass,
framebuffer: &B::Framebuffer,
render_area: Rect,
clear_values: &[ClearValue],
) -> RenderPassInlineEncoder<'_, B>
pub fn begin_render_pass_inline( &mut self, render_pass: &B::RenderPass, framebuffer: &B::Framebuffer, render_area: Rect, clear_values: &[ClearValue], ) -> RenderPassInlineEncoder<'_, B>
Beging recording render pass inline.
Sourcepub fn begin_render_pass_secondary(
&mut self,
render_pass: &B::RenderPass,
framebuffer: &B::Framebuffer,
render_area: Rect,
clear_values: &[ClearValue],
) -> RenderPassSecondaryEncoder<'_, B>
pub fn begin_render_pass_secondary( &mut self, render_pass: &B::RenderPass, framebuffer: &B::Framebuffer, render_area: Rect, clear_values: &[ClearValue], ) -> RenderPassSecondaryEncoder<'_, B>
Beging recording render pass secondary.
Sourcepub fn execute_commands(
&mut self,
submittables: impl IntoIterator<Item = impl Submittable<B, SecondaryLevel>>,
)
pub fn execute_commands( &mut self, submittables: impl IntoIterator<Item = impl Submittable<B, SecondaryLevel>>, )
Execute commands from secondary buffers.
Source§impl<'a, B, C, L> Encoder<'a, B, C, L>where
B: Backend,
impl<'a, B, C, L> Encoder<'a, B, C, L>where
B: Backend,
Sourcepub unsafe fn copy_buffer(
&mut self,
src: &B::Buffer,
dst: &B::Buffer,
regions: impl IntoIterator<Item = BufferCopy>,
)
pub unsafe fn copy_buffer( &mut self, src: &B::Buffer, dst: &B::Buffer, regions: impl IntoIterator<Item = BufferCopy>, )
Copy buffer regions.
src
and dst
can be the same buffer or alias in memory.
But regions must not overlap.
Otherwise resulting values are undefined.
§Safety
The size of the copy region in any regions
must not exceed the
length of the corresponding buffer.
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdCopyBuffer.html
Sourcepub unsafe fn copy_buffer_to_image(
&mut self,
src: &B::Buffer,
dst: &B::Image,
dst_layout: Layout,
regions: impl IntoIterator<Item = BufferImageCopy>,
)
pub unsafe fn copy_buffer_to_image( &mut self, src: &B::Buffer, dst: &B::Image, dst_layout: Layout, regions: impl IntoIterator<Item = BufferImageCopy>, )
Copy buffer region to image subresource range.
§Safety
Same as copy_buffer()
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdCopyBufferToImage.html
Sourcepub unsafe fn copy_image(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Image,
dst_layout: Layout,
regions: impl IntoIterator<Item = ImageCopy>,
)
pub unsafe fn copy_image( &mut self, src: &B::Image, src_layout: Layout, dst: &B::Image, dst_layout: Layout, regions: impl IntoIterator<Item = ImageCopy>, )
Copy image regions.
§Safety
Same as copy_buffer()
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdCopyImage.html
Sourcepub unsafe fn blit_image(
&mut self,
src: &B::Image,
src_layout: Layout,
dst: &B::Image,
dst_layout: Layout,
filter: Filter,
regions: impl IntoIterator<Item = ImageBlit>,
)
pub unsafe fn blit_image( &mut self, src: &B::Image, src_layout: Layout, dst: &B::Image, dst_layout: Layout, filter: Filter, regions: impl IntoIterator<Item = ImageBlit>, )
Blit image regions, potentially using specified filter when resize is necessary.
§Safety
Same as copy_buffer()
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdBlitImage.html
Sourcepub unsafe fn dispatch(&mut self, x: u32, y: u32, z: u32)
pub unsafe fn dispatch(&mut self, x: u32, y: u32, z: u32)
Dispatch compute.
§Safety
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDispatch.html
Sourcepub unsafe fn dispatch_indirect(&mut self, buffer: &B::Buffer, offset: u64)
pub unsafe fn dispatch_indirect(&mut self, buffer: &B::Buffer, offset: u64)
Dispatch indirect.
Similar to dispatch
except takes vertices and indices from buffer
at specified offset
.
buffer
must contain DispatchCommand
at offset
.
§Safety
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDispatchIndirect.html
Methods from Deref<Target = EncoderCommon<'a, B, C>>§
Sourcepub unsafe fn bind_index_buffer<'b>(
&mut self,
buffer: &'b B::Buffer,
offset: u64,
index_type: IndexType,
)
pub unsafe fn bind_index_buffer<'b>( &mut self, buffer: &'b B::Buffer, offset: u64, index_type: IndexType, )
Bind index buffer.
Last bound index buffer is used in draw_indexed
command.
Note that draw*
commands available only inside renderpass.
§Safety
offset
must not be greater than the size of buffer
.
Sum of offset
and starting address of the buffer
must be
multiple of index size indicated by index_type
.
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdBindIndexBuffer.html
Sourcepub unsafe fn bind_vertex_buffers<'b>(
&mut self,
first_binding: u32,
buffers: impl IntoIterator<Item = (&'b B::Buffer, u64)>,
)
pub unsafe fn bind_vertex_buffers<'b>( &mut self, first_binding: u32, buffers: impl IntoIterator<Item = (&'b B::Buffer, u64)>, )
Bind vertex buffers.
Last bound vertex buffer is used in draw
and draw_indexed
commands.
Note that draw*
commands available only inside renderpass.
§Safety
first_binding + buffers.into_iter().count()
must less than or equal to the maxVertexInputBindings
device limit.
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdBindVertexBuffers.html
Sourcepub fn bind_graphics_pipeline(&mut self, pipeline: &B::GraphicsPipeline)
pub fn bind_graphics_pipeline(&mut self, pipeline: &B::GraphicsPipeline)
Bind graphics pipeline.
Last bound vertex buffer is used in [draw
], [draw_indexed
], draw_indirect
and draw_indexed_indirect
commands.
Sourcepub unsafe fn bind_graphics_descriptor_sets<'b>(
&mut self,
layout: &B::PipelineLayout,
first_set: u32,
sets: impl IntoIterator<Item = &'b B::DescriptorSet>,
offsets: impl IntoIterator<Item = u32>,
)
pub unsafe fn bind_graphics_descriptor_sets<'b>( &mut self, layout: &B::PipelineLayout, first_set: u32, sets: impl IntoIterator<Item = &'b B::DescriptorSet>, offsets: impl IntoIterator<Item = u32>, )
Bind descriptor sets to graphics pipeline.
§Safety
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdBindDescriptorSets.html
Sourcepub fn bind_compute_pipeline(&mut self, pipeline: &B::ComputePipeline)
pub fn bind_compute_pipeline(&mut self, pipeline: &B::ComputePipeline)
Bind compute pipeline.
Sourcepub unsafe fn bind_compute_descriptor_sets<'b>(
&mut self,
layout: &B::PipelineLayout,
first_set: u32,
sets: impl IntoIterator<Item = &'b B::DescriptorSet>,
offsets: impl IntoIterator<Item = u32>,
)
pub unsafe fn bind_compute_descriptor_sets<'b>( &mut self, layout: &B::PipelineLayout, first_set: u32, sets: impl IntoIterator<Item = &'b B::DescriptorSet>, offsets: impl IntoIterator<Item = u32>, )
Bind descriptor sets to compute pipeline.
§Safety
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdBindDescriptorSets.html
Sourcepub unsafe fn pipeline_barrier<'b>(
&mut self,
stages: Range<PipelineStage>,
dependencies: Dependencies,
barriers: impl IntoIterator<Item = Barrier<'b, B>>,
)
pub unsafe fn pipeline_barrier<'b>( &mut self, stages: Range<PipelineStage>, dependencies: Dependencies, barriers: impl IntoIterator<Item = Barrier<'b, B>>, )
Insert pipeline barrier.
§Safety
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdPipelineBarrier.html
Sourcepub unsafe fn push_constants<'b>(
&mut self,
layout: &B::PipelineLayout,
stages: ShaderStageFlags,
offset: u32,
constants: &[u32],
)
pub unsafe fn push_constants<'b>( &mut self, layout: &B::PipelineLayout, stages: ShaderStageFlags, offset: u32, constants: &[u32], )
Push graphics constants.
§Safety
offset
must be multiple of 4.
constants.len() + offset
, must be less than or equal to the
maxPushConstantsSize
device limit.
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdPushConstants.html
Sourcepub unsafe fn set_viewports<'b>(
&mut self,
first_viewport: u32,
viewports: impl IntoIterator<Item = &'b Viewport>,
)
pub unsafe fn set_viewports<'b>( &mut self, first_viewport: u32, viewports: impl IntoIterator<Item = &'b Viewport>, )
Set viewports
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetViewport.html
Sourcepub unsafe fn set_scissors<'b>(
&mut self,
first_scissor: u32,
rects: impl IntoIterator<Item = &'b Rect>,
)
pub unsafe fn set_scissors<'b>( &mut self, first_scissor: u32, rects: impl IntoIterator<Item = &'b Rect>, )
Set scissors
§Safety
first_scissor + rects.count()
must be less than the
maxViewports
device limit.
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetScissor.html
Sourcepub unsafe fn set_stencil_reference(&mut self, faces: Face, value: StencilValue)
pub unsafe fn set_stencil_reference(&mut self, faces: Face, value: StencilValue)
Set the stencil reference dynamic state
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetStencilReference.html
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)
Set the stencil compare mask dynamic state
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetStencilCompareMask.html
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, )
Set the stencil write mask dynamic state
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetStencilWriteMask.html
Sourcepub unsafe fn set_blend_constants(&mut self, color: ColorValue)
pub unsafe fn set_blend_constants(&mut self, color: ColorValue)
Set the values of blend constants
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetBlendConstants.html
Sourcepub unsafe fn set_depth_bounds(&mut self, bounds: Range<f32>)
pub unsafe fn set_depth_bounds(&mut self, bounds: Range<f32>)
Set the depth bounds test values
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetDepthBounds.html
Sourcepub unsafe fn set_line_width(&mut self, width: f32)
pub unsafe fn set_line_width(&mut self, width: f32)
Set the dynamic line width state
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetLineWidth.html
Sourcepub unsafe fn set_depth_bias(&mut self, depth_bias: DepthBias)
pub unsafe fn set_depth_bias(&mut self, depth_bias: DepthBias)
Set the depth bias dynamic state
See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetDepthBias.html
Sourcepub fn reborrow<K>(&mut self) -> EncoderCommon<'_, B, K>where
C: Supports<K>,
pub fn reborrow<K>(&mut self) -> EncoderCommon<'_, B, K>where
C: Supports<K>,
Reborrow encoder.