Struct gfx_device_gl::CommandBuffer
[−]
[src]
pub struct CommandBuffer { pub buf: Vec<Command>, pub data: DataBuffer, pub display_fb: FrameBuffer, // some fields omitted }
A command buffer abstraction for OpenGL.
Manages a list of commands that will be executed when submitted to a Device
. Usually it is
best to use a Encoder
to manage the command buffer which implements From<CommandBuffer>
.
If you want to display your rendered results to a framebuffer created externally, see the
display_fb
field.
Fields
buf: Vec<Command>
data: DataBuffer
display_fb: FrameBuffer
The framebuffer to use for rendering to the main targets (0 by default).
Use this to set the framebuffer that will be used for the screen display targets created
with create_main_targets_raw
. Usually you don't need to set this field directly unless
your OS doesn't provide a default framebuffer with name 0 and you have to render to a
different framebuffer object that can be made visible on the screen (iOS/tvOS need this).
This framebuffer must exist and be configured correctly (with renderbuffer attachments, etc.) so that rendering to it can occur immediately.
Methods
impl CommandBuffer
[src]
fn new(fbo: FrameBuffer, workarounds: Workarounds) -> CommandBuffer
[src]
Trait Implementations
impl Buffer<Resources> for CommandBuffer
[src]
fn reset(&mut self)
[src]
Reset the command buffer contents, retain the allocated storage
fn bind_pipeline_state(&mut self, pso: PipelineState)
[src]
Bind a pipeline state object
fn bind_vertex_buffers(&mut self, vbs: VertexBufferSet<Resources>)
[src]
Bind a complete set of vertex buffers
fn bind_constant_buffers(&mut self, cbs: &[ConstantBufferParam<Resources>])
[src]
Bind a complete set of constant buffers
fn bind_global_constant(&mut self, loc: Location, value: UniformValue)
[src]
Bind a global constant
fn bind_resource_views(&mut self, srvs: &[ResourceViewParam<Resources>])
[src]
Bind a complete set of shader resource views
fn bind_unordered_views(&mut self, uavs: &[UnorderedViewParam<Resources>])
[src]
Bind a complete set of unordered access views
fn bind_samplers(&mut self, ss: &[SamplerParam<Resources>])
[src]
Bind a complete set of samplers
fn bind_pixel_targets(&mut self, pts: PixelTargetSet<Resources>)
[src]
Bind a complete set of pixel targets, including multiple colors views and an optional depth/stencil view. Read more
fn bind_index(&mut self, buf: Buffer, itype: IndexType)
[src]
Bind an index buffer
fn set_scissor(&mut self, rect: Rect)
[src]
Set scissor rectangle
fn set_ref_values(&mut self, rv: RefValues)
[src]
Set reference values for the blending and stencil front/back
fn copy_buffer(
&mut self,
src: Buffer,
dst: Buffer,
src_offset_bytes: usize,
dst_offset_bytes: usize,
size_bytes: usize
)
[src]
&mut self,
src: Buffer,
dst: Buffer,
src_offset_bytes: usize,
dst_offset_bytes: usize,
size_bytes: usize
)
Copy part of a buffer to another
fn copy_buffer_to_texture(
&mut self,
src: Buffer,
src_offset_bytes: usize,
dst: NewTexture,
kind: Kind,
face: Option<CubeFace>,
img: RawImageInfo
)
[src]
&mut self,
src: Buffer,
src_offset_bytes: usize,
dst: NewTexture,
kind: Kind,
face: Option<CubeFace>,
img: RawImageInfo
)
Copy part of a buffer to a texture
fn copy_texture_to_buffer(
&mut self,
src: NewTexture,
kind: Kind,
face: Option<CubeFace>,
img: RawImageInfo,
dst: Buffer,
dst_offset_bytes: usize
)
[src]
&mut self,
src: NewTexture,
kind: Kind,
face: Option<CubeFace>,
img: RawImageInfo,
dst: Buffer,
dst_offset_bytes: usize
)
Copy part of a texture to a buffer
fn update_buffer(&mut self, buf: Buffer, data: &[u8], offset_bytes: usize)
[src]
Update a vertex/index/uniform buffer
fn update_texture(
&mut self,
ntex: NewTexture,
kind: Kind,
face: Option<CubeFace>,
data: &[u8],
img: RawImageInfo
)
[src]
&mut self,
ntex: NewTexture,
kind: Kind,
face: Option<CubeFace>,
data: &[u8],
img: RawImageInfo
)
Update a texture
fn generate_mipmap(&mut self, srv: ResourceView)
[src]
fn clear_color(&mut self, target: TargetView, value: ClearColor)
[src]
Clear color target
fn clear_depth_stencil(
&mut self,
target: TargetView,
depth: Option<Depth>,
stencil: Option<Stencil>
)
[src]
&mut self,
target: TargetView,
depth: Option<Depth>,
stencil: Option<Stencil>
)
fn call_draw(
&mut self,
start: VertexCount,
count: VertexCount,
instances: Option<InstanceParams>
)
[src]
&mut self,
start: VertexCount,
count: VertexCount,
instances: Option<InstanceParams>
)
Draw a primitive
fn call_draw_indexed(
&mut self,
start: VertexCount,
count: VertexCount,
base: VertexCount,
instances: Option<InstanceParams>
)
[src]
&mut self,
start: VertexCount,
count: VertexCount,
base: VertexCount,
instances: Option<InstanceParams>
)
Draw a primitive with index buffer