pub struct CommandEncoder<'a> { /* private fields */ }Expand description
records commands; finish() makes a CommandBuffer for Queue::submit
Implementations§
Source§impl<'a> CommandEncoder<'a>
impl<'a> CommandEncoder<'a>
pub fn copy_buffer( &mut self, src: &'a Buffer, src_off: u64, dst: &'a Buffer, dst_off: u64, size: u64, )
Sourcepub fn fill_buffer(
&mut self,
buf: &'a Buffer,
offset: u64,
size: u64,
value: u32,
)
pub fn fill_buffer( &mut self, buf: &'a Buffer, offset: u64, size: u64, value: u32, )
fill size bytes at offset with a 32-bit value (both multiples of 4)
Sourcepub fn copy_buffer_to_texture(
&mut self,
src: &'a Buffer,
layout: DataLayout,
dst: TextureRegion<'a>,
)
pub fn copy_buffer_to_texture( &mut self, src: &'a Buffer, layout: DataLayout, dst: TextureRegion<'a>, )
buffer data -> a texture region
Sourcepub fn copy_texture_to_buffer(
&mut self,
src: TextureRegion<'a>,
dst: &'a Buffer,
layout: DataLayout,
)
pub fn copy_texture_to_buffer( &mut self, src: TextureRegion<'a>, dst: &'a Buffer, layout: DataLayout, )
a texture region -> buffer data
pub fn texture_barrier( &mut self, _tex: &'a Texture, _before: Layout, _after: Layout, )
pub fn texture_barrier_range( &mut self, _tex: &'a Texture, _base_mip: u32, _mips: u32, _base_layer: u32, _layers: u32, _before: Layout, _after: Layout, )
pub fn set_compute_pipeline(&mut self, p: &'a ComputePipeline)
Sourcepub fn set_bind_group(&mut self, index: u32, group: &'a BindGroup)
pub fn set_bind_group(&mut self, index: u32, group: &'a BindGroup)
bind group g (= @group(g)) of the current pipeline’s layout
Sourcepub fn push_constants<T: Pod>(&mut self, offset: u32, data: &[T])
pub fn push_constants<T: Pod>(&mut self, offset: u32, data: &[T])
push constants at offset (bytes) for the current pipeline (a uniform block in the browser)
pub fn dispatch(&mut self, x: u32, y: u32, z: u32)
Sourcepub fn dispatch_indirect(&mut self, buf: &'a Buffer, offset: u64)
pub fn dispatch_indirect(&mut self, buf: &'a Buffer, offset: u64)
workgroup counts (3 x u32) from buf at offset
pub fn begin_render(&mut self, desc: &RenderPassDesc<'_, 'a>)
pub fn end_render(&mut self)
pub fn set_render_pipeline(&mut self, p: &'a RenderPipeline)
Sourcepub fn set_viewport(
&mut self,
x: f32,
y: f32,
w: f32,
h: f32,
min_depth: f32,
max_depth: f32,
)
pub fn set_viewport( &mut self, x: f32, y: f32, w: f32, h: f32, min_depth: f32, max_depth: f32, )
the viewport in pixels from the top left (depth range min ..= max)
pub fn set_scissor(&mut self, x: u32, y: u32, w: u32, h: u32)
pub fn set_vertex_buffer(&mut self, slot: u32, buf: &'a Buffer, offset: u64)
pub fn set_index_buffer( &mut self, buf: &'a Buffer, offset: u64, format: IndexFormat, )
pub fn draw( &mut self, vertices: u32, instances: u32, first_vertex: u32, first_instance: u32, )
pub fn draw_indexed( &mut self, indices: u32, instances: u32, first_index: u32, base_vertex: i32, first_instance: u32, )
Sourcepub fn draw_indirect(&mut self, buf: &'a Buffer, offset: u64)
pub fn draw_indirect(&mut self, buf: &'a Buffer, offset: u64)
one draw: vertex count, instance count, first vertex, first instance (4 x u32)
Sourcepub fn draw_indexed_indirect(&mut self, buf: &'a Buffer, offset: u64)
pub fn draw_indexed_indirect(&mut self, buf: &'a Buffer, offset: u64)
one indexed draw: index count, instance count, first index, base vertex (i32), first instance
Sourcepub fn draw_indexed_indirect_multi(
&mut self,
_buf: &'a Buffer,
_offset: u64,
_count: u32,
_stride: u32,
)
pub fn draw_indexed_indirect_multi( &mut self, _buf: &'a Buffer, _offset: u64, _count: u32, _stride: u32, )
(level Voll)
Sourcepub fn draw_indexed_indirect_count(
&mut self,
_buf: &'a Buffer,
_offset: u64,
_count_buf: &'a Buffer,
_count_offset: u64,
_max_count: u32,
_stride: u32,
)
pub fn draw_indexed_indirect_count( &mut self, _buf: &'a Buffer, _offset: u64, _count_buf: &'a Buffer, _count_offset: u64, _max_count: u32, _stride: u32, )
(level Voll)
Sourcepub fn reset_timestamps(&mut self, _ts: &'a Timestamps, _first: u32, _n: u32)
pub fn reset_timestamps(&mut self, _ts: &'a Timestamps, _first: u32, _n: u32)
(not built in the browser)
Sourcepub fn timestamp(&mut self, _ts: &'a Timestamps, _i: u32)
pub fn timestamp(&mut self, _ts: &'a Timestamps, _i: u32)
(not built in the browser)
Sourcepub fn finish(self) -> Result<CommandBuffer<'a>>
pub fn finish(self) -> Result<CommandBuffer<'a>>
the recorded commands, or the first misuse
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CommandEncoder<'a>
impl<'a> !Send for CommandEncoder<'a>
impl<'a> !Sync for CommandEncoder<'a>
impl<'a> !UnwindSafe for CommandEncoder<'a>
impl<'a> Forget for CommandEncoder<'a>
impl<'a> Freeze for CommandEncoder<'a>
impl<'a> Unpin for CommandEncoder<'a>
impl<'a> UnsafeUnpin for CommandEncoder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more