Module gfx::pso[][src]

A typed high-level graphics pipeline interface.

Overview

A PipelineState holds all information needed to manage a graphics pipeline. It contains information about the shaders used, and on how to bind variables to these shaders. A PipelineState manifests itself in the form of a Pipeline State Object, or PSO in short.

A Pipeline State Object exists out of different components. Every component represents a resource handle: a shader input or output/target. The types of these components can be found in this module’s submodules, grouped by category.

Before all, a Pipeline State Object must be defined. This is done using the gfx_pipeline macro. This macro creates three different structures:

Construction and Handling

A Pipeline State Object is constructed by a factory, from its Init structure, a Rasterizer, a primitive type and a shader program.

After construction an Encoder can use the PSO along with a Data structure matching that PSO to process the shader pipeline, for instance, using the draw method.

Modules

buffer

Buffer components for a PSO.

bundle

Combine slice data with pipeline state.

resource

Resource components for a PSO.

target

Render target components for a PSO.

Structs

AccessInfo

Informations about what is accessed by a bunch of commands.

Descriptor

All the information surrounding a shader program that is required for PSO creation, including the formats of vertex buffers and pixel targets;

PipelineState

A strongly typed Pipleline State Object. See the module documentation for more information.

RawDataSet

A complete set of raw data that needs to be specified at run-time whenever we draw something with a PSO. This is what “data” struct gets transformed into when we call encoder.draw(...) with it. It doesn’t have any typing information, since PSO knows what format and layout to expect from each resource.

Enums

ElementError

Error matching an element inside the constant buffer.

InitError

Failure to initilize the link between the shader and the data.

Traits

DataBind

The “bind” logic portion of the PSO component. Defines how the user data translates into the raw data set.

DataLink

The “link” logic portion of a PSO component. Defines the input data for the component.

PipelineData

a service trait implemented the “data” structure of PSO.

PipelineInit

A service trait implemented by the “init” structure of PSO.