rendy_command

Struct RenderPassEncoder

Source
pub struct RenderPassEncoder<'a, B: Backend> { /* private fields */ }
Expand description

Special encoder to record render-pass commands.

Implementations§

Source§

impl<'a, B> RenderPassEncoder<'a, B>
where B: Backend,

Source

pub unsafe fn clear_attachments( &mut self, clears: impl IntoIterator<Item = impl Borrow<AttachmentClear>>, rects: impl IntoIterator<Item = impl Borrow<ClearRect>>, )

Clear regions within bound framebuffer attachments

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdClearAttachments.html#vkCmdBeginRenderPass

Source

pub unsafe fn draw(&mut self, vertices: Range<u32>, instances: Range<u32>)

Draw.

§Safety

The range of vertices must not exceed the size of the currently bound vertex buffer, and the range of instances must not exceed the size of the currently bound instance buffer.

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDraw.html

Source

pub unsafe fn draw_indexed( &mut self, indices: Range<u32>, base_vertex: i32, instances: Range<u32>, )

Draw indexed, with base_vertex specifying an offset that is treated as vertex number 0.

§Safety

Same as draw(), plus the value of base_vertex. So, base_vertex + indices.end must not be larger than the currently bound vertex buffer.

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDrawIndexed.html

Source

pub unsafe fn draw_indirect( &mut self, buffer: &B::Buffer, offset: u64, draw_count: u32, stride: u32, )

Draw indirect. Similar to draw except takes vertices and instance data from buffer at specified offset. buffer must contain draw_count of DrawCommand starting from offset with stride bytes between each.

§Safety

Similar to draw().

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDrawIndirect.html

Source

pub unsafe fn draw_indexed_indirect( &mut self, buffer: &B::Buffer, offset: u64, draw_count: u32, stride: u32, )

Draw indirect with indices. Similar to [draw_indexed] except takes vertices, indices and instance data from buffer at specified offset. buffer must contain draw_count of DrawIndexedCommand starting from offset with stride bytes between each.

§Safety

Similar to draw_indexed()

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdDrawIndexedIndirect.html

Source

pub fn reborrow(&mut self) -> RenderPassEncoder<'_, B>

Reborrow encoder.

Methods from Deref<Target = EncoderCommon<'a, B, Graphics>>§

Source

pub unsafe fn bind_index_buffer<'b>( &mut self, buffer: &'b B::Buffer, offset: u64, index_type: IndexType, )
where C: Supports<Graphics>,

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

Source

pub unsafe fn bind_vertex_buffers<'b>( &mut self, first_binding: u32, buffers: impl IntoIterator<Item = (&'b B::Buffer, u64)>, )
where C: Supports<Graphics>,

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

Source

pub fn bind_graphics_pipeline(&mut self, pipeline: &B::GraphicsPipeline)
where C: Supports<Graphics>,

Bind graphics pipeline.

Last bound vertex buffer is used in [draw], [draw_indexed], draw_indirect and draw_indexed_indirect commands.

Source

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>, )
where C: Supports<Graphics>,

Bind descriptor sets to graphics pipeline.

§Safety

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdBindDescriptorSets.html

Source

pub fn bind_compute_pipeline(&mut self, pipeline: &B::ComputePipeline)
where C: Supports<Compute>,

Bind compute pipeline.

Source

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>, )
where C: Supports<Compute>,

Bind descriptor sets to compute pipeline.

§Safety

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdBindDescriptorSets.html

Source

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

Source

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

Source

pub unsafe fn set_viewports<'b>( &mut self, first_viewport: u32, viewports: impl IntoIterator<Item = &'b Viewport>, )
where C: Supports<Graphics>,

Set viewports

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetViewport.html

Source

pub unsafe fn set_scissors<'b>( &mut self, first_scissor: u32, rects: impl IntoIterator<Item = &'b Rect>, )
where C: Supports<Graphics>,

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

Source

pub unsafe fn set_stencil_reference(&mut self, faces: Face, value: StencilValue)
where C: Supports<Graphics>,

Set the stencil reference dynamic state

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetStencilReference.html

Source

pub unsafe fn set_stencil_read_mask(&mut self, faces: Face, value: StencilValue)
where C: Supports<Graphics>,

Set the stencil compare mask dynamic state

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetStencilCompareMask.html

Source

pub unsafe fn set_stencil_write_mask( &mut self, faces: Face, value: StencilValue, )
where C: Supports<Graphics>,

Set the stencil write mask dynamic state

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetStencilWriteMask.html

Source

pub unsafe fn set_blend_constants(&mut self, color: ColorValue)
where C: Supports<Graphics>,

Set the values of blend constants

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetBlendConstants.html

Source

pub unsafe fn set_depth_bounds(&mut self, bounds: Range<f32>)
where C: Supports<Graphics>,

Set the depth bounds test values

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetDepthBounds.html

Source

pub unsafe fn set_line_width(&mut self, width: f32)
where C: Supports<Graphics>,

Set the dynamic line width state

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetLineWidth.html

Source

pub unsafe fn set_depth_bias(&mut self, depth_bias: DepthBias)
where C: Supports<Graphics>,

Set the depth bias dynamic state

See: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCmdSetDepthBias.html

Source

pub fn reborrow<K>(&mut self) -> EncoderCommon<'_, B, K>
where C: Supports<K>,

Reborrow encoder.

Trait Implementations§

Source§

impl<'a, B: Debug + Backend> Debug for RenderPassEncoder<'a, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, B> Deref for RenderPassEncoder<'a, B>
where B: Backend,

Source§

type Target = EncoderCommon<'a, B, Graphics>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &EncoderCommon<'a, B, Graphics>

Dereferences the value.
Source§

impl<'a, B> DerefMut for RenderPassEncoder<'a, B>
where B: Backend,

Source§

fn deref_mut(&mut self) -> &mut EncoderCommon<'a, B, Graphics>

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, B> Freeze for RenderPassEncoder<'a, B>

§

impl<'a, B> RefUnwindSafe for RenderPassEncoder<'a, B>

§

impl<'a, B> Send for RenderPassEncoder<'a, B>

§

impl<'a, B> Sync for RenderPassEncoder<'a, B>

§

impl<'a, B> Unpin for RenderPassEncoder<'a, B>

§

impl<'a, B> !UnwindSafe for RenderPassEncoder<'a, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.