Graphics Reference
In-Depth Information
Figure 3.3. The assembly language view of the common shader core.
must be written in HLSL, they must still be compiled into this assembly byte code before
being used in the rendering pipeline. 1 2
We can learn a great deal of information from this assembly language. It defines
a specific set of registers that can be used by the compiler to map an HLSL program to
assembly language. The registers are generally four component vector registers, which
can use individual components to provide scalar register functionality as well. There are
registers for a shader core to receive its input data, temporary registers for performing com-
putations, registers for interacting with resources, and registers for passing data out of the
stage. The assembly language instructions use these registers to perform their respective
operations. By understanding how the assembly programs can use these registers, we can
gain a deep insight into how shader stages operate.
To get started, we will consider the common shader core overview shown in
Figure 3.2, but this time we will view it from an assembly language viewpoint. Figure 3.3
shows the assembly version of the common shader core.
1 The assembly program produced by compiling an HLSL program is not directly executed in the GPU. It is
further processed by the video driver into machine-specific instructions, which can vary from GPU to GPU.
Even so, the assembly language provides a common point of reference with which we can gain an insight into
the operations of a shader processor.
2 The details of the compilation process can be found in Chapter 6, "The High Level Shading Language.'
Search WWH ::




Custom Search