Graphics Reference
In-Depth Information
6.2.4 Binding to the Pipeline
Shader objects are bound to the pipeline by calling the various *SetShader methods avail-
able on an ID3D11DeviceContext. Once all required shader objects are bound to their cor-
responding stages, a Draw call can be issued, and the bound shader programs will be used
to render the geometry. Or in the case of compute shaders, a Dispatch call can be issued,
instead, to use the compute pipeline. If the shader program uses shader resources, sam-
plers, or constant buffers, these must be bound before issuing the Draw or Dispatch call.
This is done by calling the appropriate *SetShaderResources, *SetConstantBuffers,
and *SetSamplers methods on the device context. Unordered access views are bound to
the compute shader stage using CSSetUnorderedAccessViews, and are bound to the pixel
shader stage using OMSetRenderTargetsAndUnorderedAccessViews. See Chapter 3,
"The Rendering Pipeline," and Chapter 5, "The Computation Pipeline," for more informa-
tion on configuring shader stages.
6.3 Language Basics
6.3.1 Primitive Types
High Level Shader Language features several primitive types that are common across all
shader profiles. Like the primitive types in C++, HLSL primitives consist of various inte-
gral and floating-point numerical types. These types are listed in Table 6.1.
Table 6.1. HLSL primitive types.
Search WWH ::




Custom Search