Pixel Shader ALU
The diagram below shows the parallel pipeline structure of a pixel shader arithmetic logic unit (ALU). The left side is the vector pipeline, which operates on vector data. Vector data is also called color data and contains three channels (RGB) of data. The right side is the scalar pipeline, which operates on a single alpha data value. The pipeline is commonly referred to by the data type operated on, so the vector pipeline is commonly called the color pipe and the scalar pipeline is commonly called the alpha pipe.
The blocks are identified below.
- Input Registers - Pixel shader registers provide the RGBA input data for a pixel shader.
- Component Copy - Source register selectors copy data from one channel into other channels. This is commonly called swizzling.
- Modify Data - Source register modifiers modify data read from source registers before an instruction is executed.
- Execute Instruction - Instructions are used to perform arithmetic and texture address operations on the pixel data. The color and alpha pipes do not have to execute the same instruction or have the same source registers. For pixel shader version 1.4, destination registers may also be different across the two pipes.
- Modify Result - Instruction modifiers modify the result of the instruction before it is written to an output register.
- Masking - Destination register write masks control which components of the destination register are written by the instruction.
Output Register - At the end of the shader, pixel shader register r0 contains the output color.