Expand description
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:
- The
Initstructure contains the location of every PSO component. During shader linking, this is used to construct theMetastructure. - The
Metastructure contains the layout of every PSO. Using theMetastructure, the right data is mapped to the right components. - The
Datastructure contains the data of all components, to be sent to the GPU.
§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§
- Access
Info - 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;
- Pipeline
State - A strongly typed Pipleline State Object. See the module documentation for more information.
- RawData
Set - 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§
- Element
Error - Error matching an element inside the constant buffer.
- Init
Error - Failure to initilize the link between the shader and the data.
Traits§
- Data
Bind - The “bind” logic portion of the PSO component. Defines how the user data translates into the raw data set.
- Data
Link - The “link” logic portion of a PSO component. Defines the input data for the component.
- Pipeline
Data - a service trait implemented the “data” structure of PSO.
- Pipeline
Init - A service trait implemented by the “init” structure of PSO.