Struct gfx::Encoder [] [src]

pub struct Encoder<R: Resources, C> { /* fields omitted */ }

Graphics Command Encoder

Overview

The Encoder is a wrapper structure around a CommandBuffer. It is responsible for sending commands to the CommandBuffer.

Construction & Handling

The Encoder implements From<CommandBuffer>, which is how it is constructed. There is no cross-API way to create a CommandBuffer, however, an API back-end should expose a function to create one in its Factory type. See the specific back-end for details on how to construct a CommandBuffer.

The encoder exposes multiple functions that add commands to its internal CommandBuffer. To submit these commands to the GPU so they can be rendered, call flush.

Methods

impl<R: Resources, C: Buffer<R>> Encoder<R, C>
[src]

[src]

Submits the commands in this Encoder's internal CommandBuffer to the GPU, so they can be executed.

Calling flush before swapping buffers is critical as without it the commands of the internal ´CommandBuffer´ will not be sent to the GPU, and as a result they will not be processed. Calling flush too often however will result in a performance hit. It is generally recommended to call flush once per frame, when all draw calls have been made.

[src]

Like flush but keeps the encoded commands.

[src]

Like flush_no_reset but places a fence.

[src]

Resets the encoded commands.

[src]

Copy part of a buffer to another

[src]

Copy part of a buffer to a texture

[src]

Copy part of a texture to a buffer

[src]

Copy part of a texture to another texture

[src]

Update a buffer with a slice of data.

[src]

Update a buffer with a single structure.

[src]

Update the contents of a texture.

[src]

Clears the supplied RenderTargetView to the supplied ClearColor.

[src]

Clear a depth view with a specified value.

[src]

Clear a stencil view with a specified value.

[src]

Draws a slice::Slice using a pipeline state object, and its matching Data structure.

[src]

Generate a mipmap chain for the given resource view.

[src]

Untyped version of mipmap generation.

Trait Implementations

impl<R: Debug + Resources, C: Debug> Debug for Encoder<R, C>
[src]

[src]

Formats the value using the given formatter.

impl<R: Resources, C> From<C> for Encoder<R, C>
[src]

[src]

Performs the conversion.