源参数令牌描述源寄存器的属性,由以下位组成:
位
[10:00] Bits 0 through 10 indicate the register number (offset in register file).
[12:11] Bits 11 and 12 are the fourth and fifth bits [3,4] for indicating the register type.
[13] For a pixel shader (PS) versions earlier than 3_0, bit 13 is reserved and set to 0x0.
对于像素着色器(PS)版本 3_0 及更高版本及所有版本的顶点着色器(VS),位 13 指示是否使用相对寻址模式。 If set to 1, relative addressing applies.
[15:14] Reserved for all versions of PS and VS. 此值设置为0x0。
[23:16] Bits 16 through 23 indicate channel swizzle. 所有算术运算都在四个 (X,Y,Z,W) 并行通道中执行。 重排指定哪个源组件参与作通道。 有关重排的详细信息,请参阅最新的 DirectX SDK 文档。 此字段的位指定以下通道的重排:
| Bits | Channel |
|---|---|
17:16 |
通道 X 重排 |
19:18 |
频道 Y 重排 |
21:20 |
通道 Z 重排 |
23:22 |
通道 W 重排 |
上述任意位集中的以下值指定要在作通道中使用的源组件:
| Value | Component |
|---|---|
0x0 |
使用组件 X。 |
0x1 |
使用组件 Y。 |
0x2 |
使用组件 Z。 |
0x3 |
使用组件 W。 |
例如,如果将 19:18 位设置为0x2,则组件 Z 用作通道 Y作的源。
[27:24] Bits 24 through 27 indicate the source modifier. 此 4 位值指示以下源修饰符类型:
| Value | 源修饰符类型 |
|---|---|
0x0 |
None |
0x1 |
Negate |
0x2 |
Bias |
0x3 |
偏差和否定 |
0x4 |
Sign (bx2) |
0x5 |
标记 (bx2) 和否定 |
0x6 |
Complement |
0x7 |
x2 (PS 1_4) |
0x8 |
x2 和否定 (PS 1_4) |
0x9 |
z (除以 Z 分量 - PS 1_4) |
0xa |
dw (除以 W 组件 âˆ' PS 1_4) |
0xb |
abs(x) 计算绝对值 |
0xc |
-abs(x) 计算绝对值和求反值 |
0xd |
NOT. 仅适用于 BOOL 的谓词寄存器。 因此,它是逻辑 NOT。 |
0xe-0xf |
Reserved |
[30:28] Bits 28 through 30 are the first three bits [0,1,2] for indicating the register type.
[31] Bit 31 is 0x1.
批注
位 28、29、30、11 和 12 形成一个指示寄存器类型的 5 位值。 有关注册类型的信息,请参阅 着色器寄存器类型。
要求
在 Windows Vista 和更高版本的 Windows作系统中可用。