pub struct Encoder<'a> { /* private fields */ }
Expand description
Command encoder that can encode commands outside render pass.
Implementations§
source§impl<'a> Encoder<'a>
impl<'a> Encoder<'a>
sourcepub fn with_framebuffer(
&mut self,
framebuffer: &'a Framebuffer,
clears: &[ClearValue]
) -> RenderPassEncoder<'_, 'a>
pub fn with_framebuffer(
&mut self,
framebuffer: &'a Framebuffer,
clears: &[ClearValue]
) -> RenderPassEncoder<'_, 'a>
Begins render pass and returns RenderPassEncoder
to encode commands of
the render pass. RenderPassEncoder
borrows Encoder
.
To continue use this Encoder
returned RenderPassEncoder
must be
dropped which implicitly ends render pass.
framebuffer
- a framebuffer (set of attachments) for render pass to use.
clears
- an array of clear values. render pass will clear attachments
with load_op == LoadOp::Clear
using those values.
They will be used in order.
sourcepub fn with_render_pass<R, I>(
&mut self,
render_pass: &'a mut R,
input: &I,
device: &Device
) -> Result<RenderPassEncoder<'_, 'a>, FramebufferError>where
R: RenderPassInstance<Input = I>,
pub fn with_render_pass<R, I>(
&mut self,
render_pass: &'a mut R,
input: &I,
device: &Device
) -> Result<RenderPassEncoder<'_, 'a>, FramebufferError>where
R: RenderPassInstance<Input = I>,
Begins render pass and returns RenderPassEncoder
to encode commands of
the render pass. RenderPassEncoder
borrows Encoder
.
To continue use this Encoder
returned RenderPassEncoder
must be
dropped which implicitly ends render pass.
pass
- render pass to encode.
framebuffer
- a framebuffer (set of attachments) for render pass to use.
clears
- an array of clear values. render pass will clear attachments
with load_op == LoadOp::Clear
using those values.
They will be used in order.
sourcepub fn begin_rendering(
&mut self,
info: RenderingInfo<'_>
) -> RenderingEncoder<'_, 'a>
pub fn begin_rendering(
&mut self,
info: RenderingInfo<'_>
) -> RenderingEncoder<'_, 'a>
Begins rendering
sourcepub fn update_buffer<T>(&mut self, buffer: &Buffer, offset: u64, data: &[T])where
T: Pod,
pub fn update_buffer<T>(&mut self, buffer: &Buffer, offset: u64, data: &[T])where
T: Pod,
Updates a buffer’s contents from host memory
sourcepub fn upload_buffer<T>(
&mut self,
buffer: &'a Buffer,
offset: u64,
data: &'a [T],
device: &Device
) -> Result<(), OutOfMemory>where
T: Pod,
pub fn upload_buffer<T>(
&mut self,
buffer: &'a Buffer,
offset: u64,
data: &'a [T],
device: &Device
) -> Result<(), OutOfMemory>where
T: Pod,
Uploads data to the buffer. May create intermediate staging buffer if necessary.
sourcepub fn upload_buffer_cached<T, S>(
&mut self,
buffer: &'a Buffer,
offset: u64,
data: &'a [T],
device: &Device,
staging: &mut S
) -> Result<(), OutOfMemory>where
T: Pod,
S: AsMut<[Buffer]> + Extend<Buffer>,
pub fn upload_buffer_cached<T, S>(
&mut self,
buffer: &'a Buffer,
offset: u64,
data: &'a [T],
device: &Device,
staging: &mut S
) -> Result<(), OutOfMemory>where
T: Pod,
S: AsMut<[Buffer]> + Extend<Buffer>,
Uploads data to the buffer. Uses cached staging buffers and may create new if necessary.
sourcepub fn build_acceleration_structure(
&mut self,
infos: &[AccelerationStructureBuildGeometryInfo<'_>]
)
pub fn build_acceleration_structure(
&mut self,
infos: &[AccelerationStructureBuildGeometryInfo<'_>]
)
Builds acceleration structures.
pub fn trace_rays(
&mut self,
shader_binding_table: &'a ShaderBindingTable,
extent: Extent3
)
pub fn copy_buffer(
&mut self,
src_buffer: &Buffer,
dst_buffer: &Buffer,
regions: &[BufferCopy]
)
pub fn copy_image(
&mut self,
src_image: &Image,
src_layout: Layout,
dst_image: &Image,
dst_layout: Layout,
regions: &[ImageCopy]
)
pub fn copy_buffer_to_image(
&mut self,
src_buffer: &Buffer,
dst_image: &Image,
dst_layout: Layout,
regions: &[BufferImageCopy]
)
pub fn blit_image(
&mut self,
src_image: &Image,
src_layout: Layout,
dst_image: &Image,
dst_layout: Layout,
regions: &[ImageBlit],
filter: Filter
)
pub fn dispatch(&mut self, x: u32, y: u32, z: u32)
pub fn memory_barrier(
&mut self,
src: PipelineStages,
src_acc: Access,
dst: PipelineStages,
dst_acc: Access
)
pub fn image_barriers(
&mut self,
src: PipelineStages,
dst: PipelineStages,
images: &[ImageMemoryBarrier<'_>]
)
pub fn buffer_barriers(
&mut self,
src: PipelineStages,
dst: PipelineStages,
buffers: &[BufferMemoryBarrier<'_>]
)
sourcepub fn finish(self) -> CommandBuffer
pub fn finish(self) -> CommandBuffer
Flushes commands recorded into this encoder to the underlying command buffer.