DCL Instruction Format
The DCL instruction declares registers.
Format
Pixel shader 2_0 and later only.
Sampler state register only.
Contains D3DSIO_DCL. DWORD token
Has the following bit format:
[26:0] Reserved. Set to 0x0.
[30:27] Set to D3DSAMPLER_TEXTURE_TYPE for 2D, cube, and so on.
[31] Set to 0x1.
Indicates the register number and the register type as D3DSPR_SAMPLER. These are the only fields that are used in this token.
Input or texture register only.
Contains D3DSIO_DCL. DWORD token
Has the following bit format:
[30:0] Reserved. Set to 0x0.
[31] Set to 0x1.
Indicates input or texture register number. The write-mask field indicates declared components.
Vertex shader 2_0 and later only.
Input register only.
Contains D3DSIO_DCL. DWORD token
Has the following bit format:
[4:0] D3DDECLUSAGE value (that is, D3DDECLUSAGE_TEXCOORD, D3DDECLUSAGE_NORMAL, and so on).
[15:5] Reserved. Set to 0x0.
[19:16] Usage index value.
[30:20] Reserved. Set to 0x0.
[31] Set to 0x1.
Indicates the register number and the register type as D3DSPR_INPUT. The write-mask field indicates declared components.
Pixel shader 3_0 and later only.
Texture register only.
Contains D3DSIO_DCL. DWORD token
Has the following bit format:
[4:0] D3DDECLUSAGE value (must be D3DDECLUSAGE_TEXCOORD or D3DDECLUSAGE_COLOR).
[15:5] Reserved. Set to 0x0.
[19:16] Usage index value. For D3DDECLUSAGE_TEXCOORD, must be 0-7. For D3DDECLUSAGE_COLOR, must be 0.
[30:20] Reserved. Set to 0x0.
[31] Set to 0x1.
Indicates the register number and the register type as D3DSPR_TEXTURE. The write-mask field indicates declared components.
Face register only.
Contains D3DSIO_DCL. DWORD token
Has the following bit format:
[30:0] Reserved. Set to 0x0.
[31] Set to 0x1.
Indicates the face register. The write-mask field must be full although it is unused. The result-modifier and shift-scale fields must be 0 (also unused).
Position register only.
Contains D3DSIO_DCL. DWORD token
Has the following bit format:
[30:0] Reserved. Set to 0x0.
[31] Set to 0x1.
Indicates position register. The write-mask field indicates declared components.
Vertex shader 3_0 and later only.
Output register only.
Contains D3DSIO_DCL. DWORD token
Has the following bit format:
[4:0] D3DDECLUSAGE value (that is, D3DDECLUSAGE_TEXCOORD, D3DDECLUSAGE_NORMAL, and so on).
[15:5] Reserved. Set to 0x0.
[19:16] Usage index value.
[30:20] Reserved. Set to 0x0.
[31] Set to 0x1.
Indicates the register number and the register type as D3DSPR_OUTPUT. The write-mask field defines which components are written.
Note that several DCL instructions, which describe the output, can use the same register offset. However, the write mask components for each DCL instruction must be different. For example, the following is valid in a vertex shader 3_0 and later:
DCL o10.xy
DCL o10.zw
The output DCL instructions must declare all registers that are written by a vertex shader 3_0 and later.
Requirements
Available in Windows Vista and later versions of the Windows operating systems.