ps_2_0 Registers
Microsoft DirectX 9.0 SDK Update (October 2004)

ps_2_0 Registers


Pixel shaders depend on registers to get vertex data, to output pixel data, to hold temporary results during calculations, and to identify texture sampling stages. There are several types of registers, each with a unique functionality. This section contains reference information for the input and output registers implemented by pixel shader version 2_x.

Input Register Types

RegisterNameCountR/W# Read ports# Reads/instDimensionRelAddrDefaultsRequires DCL
v#Input Color Register2R1Unlimited4NPartial(0001). See note 4Y
r#Temporary RegisterSee note 1R/W3Unlimited4NNoneN
c#Constant Float Register32R124N0000N
i#Constant Integer Register16See note 2114N0000N
b#Constant Boolean Register16See note 2111NFALSEN
p0Predicate Register1See note 2111NNoneY
s#Sampler16See note 3114NSee note 5Y
t#Texture Coordinate Register8R111NNoneY

Notes:

  1. 12 min/32 max: The number of r# registers is determined by PS20Caps.NumTemps (which ranges from 12 to 32).
  2. Only usable by a flow control instruction.
  3. Only usable by a texture sampling instruction.
  4. partial(x, y, z, w) - If only a subset of channels are updated in the register, the remaining channels will default to specified values (x, y, z, w).
  5. Defaults for sampler lookups exist, but values depend on texture format.

The number of readports is the number of different registers (for each register type) that can be read in a single instruction.

Output Register Types

RegisterNameCountR/WDimensionRelAddrDefaults Requires DCL
oC#Output Color RegisterSee Multielement TexturesW4NNoneN
oDepthOutput Depth Register1W1NNoneN


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.