Trait gfx::device::draw::CommandBuffer [] [src]

pub trait CommandBuffer<R: Resources> {
    fn new() -> Self;
    fn clear(&mut self);
    fn bind_program(&mut self, R);
    fn bind_array_buffer(&mut self, R);
    fn bind_attribute(&mut self, AttributeSlot, R, Format);
    fn bind_index(&mut self, R);
    fn bind_frame_buffer(&mut self, Access, R, Gamma);
    fn unbind_target(&mut self, Access, Target);
    fn bind_target_surface(&mut self, Access, Target, R);
    fn bind_target_texture(&mut self, Access, Target, R, Level, Option<Layer>);
    fn bind_uniform_block(&mut self, R, UniformBufferSlot, UniformBlockIndex, R);
    fn bind_uniform(&mut self, Location, UniformValue);
    fn bind_texture(&mut self, TextureSlot, TextureKind, R, Option<(R, SamplerInfo)>);
    fn set_draw_color_buffers(&mut self, usize);
    fn set_primitive(&mut self, Primitive);
    fn set_viewport(&mut self, Rect);
    fn set_multi_sample(&mut self, Option<MultiSample>);
    fn set_scissor(&mut self, Option<Rect>);
    fn set_depth_stencil(&mut self, Option<Depth>, Option<Stencil>, CullFace);
    fn set_blend(&mut self, Option<Blend>);
    fn set_color_mask(&mut self, ColorMask);
    fn update_buffer(&mut self, R, DataPointer, usize);
    fn update_texture(&mut self, TextureKind, R, ImageInfo, DataPointer);
    fn call_clear(&mut self, ClearData, Mask);
    fn call_draw(&mut self, PrimitiveType, VertexCount, VertexCount, InstanceOption);
    fn call_draw_indexed(&mut self, PrimitiveType, IndexType, VertexCount, VertexCount, VertexCount, InstanceOption);
    fn call_blit(&mut self, Rect, Rect, Mirror, Mask);
}

An interface of the abstract command buffer. It collects commands in an efficient API-specific manner, to be ready for execution on the device.

Required Methods

fn new() -> Self

An empty constructor

fn clear(&mut self)

Clear the command buffer contents, retain the allocated storage

fn bind_program(&mut self, R)

Bind a shader program

fn bind_array_buffer(&mut self, R)

Bind an array buffer object

fn bind_attribute(&mut self, AttributeSlot, R, Format)

Bind a vertex attribute

fn bind_index(&mut self, R)

Bind an index buffer

fn bind_frame_buffer(&mut self, Access, R, Gamma)

Bind a frame buffer object

fn unbind_target(&mut self, Access, Target)

Unbind any surface from the specified target slot

fn bind_target_surface(&mut self, Access, Target, R)

Bind a surface to the specified target slot

fn bind_target_texture(&mut self, Access, Target, R, Level, Option<Layer>)

Bind a level of the texture to the specified target slot

fn bind_uniform_block(&mut self, R, UniformBufferSlot, UniformBlockIndex, R)

Bind a uniform block

fn bind_uniform(&mut self, Location, UniformValue)

Bind a single uniform in the default block

fn bind_texture(&mut self, TextureSlot, TextureKind, R, Option<(R, SamplerInfo)>)

Bind a texture

fn set_draw_color_buffers(&mut self, usize)

Select, which color buffers are going to be targetted by the shader

fn set_primitive(&mut self, Primitive)

Set primitive topology

fn set_viewport(&mut self, Rect)

Set viewport rectangle

fn set_multi_sample(&mut self, Option<MultiSample>)

Set multi-sampling state

fn set_scissor(&mut self, Option<Rect>)

Set scissor test

fn set_depth_stencil(&mut self, Option<Depth>, Option<Stencil>, CullFace)

Set depth and stencil states

fn set_blend(&mut self, Option<Blend>)

Set blend state

fn set_color_mask(&mut self, ColorMask)

Set output color mask for all targets

fn update_buffer(&mut self, R, DataPointer, usize)

Update a vertex/index/uniform buffer

fn update_texture(&mut self, TextureKind, R, ImageInfo, DataPointer)

Update a texture region

fn call_clear(&mut self, ClearData, Mask)

Clear target surfaces

fn call_draw(&mut self, PrimitiveType, VertexCount, VertexCount, InstanceOption)

Draw a primitive

fn call_draw_indexed(&mut self, PrimitiveType, IndexType, VertexCount, VertexCount, VertexCount, InstanceOption)

Draw a primitive with index buffer

fn call_blit(&mut self, Rect, Rect, Mirror, Mask)

Blit from one target to another

Implementors