Texture instructions
Direct3D 9 - Pixel Shader - Instructions - Other instructions
Last edited 2026-04-05
This section contains reference information for the pixel shader version ps_1_x, ps_2_x and ps_3_0 instructions.
There are several types of pixel shader instructions, as shown in the following table.
The "Instruction slots" column indicates how many instruction slots (Arithmetic or Texture) are required for a given instruction.
- If "Texture" or "Arithmetic" is not specified, the value is 0.
- This value may vary for a given instruction depending on whether the compiler optimizes the code automatically.
The meaning of colors in the Type column:
|
Color |
Description |
|
Green |
The instruction works. |
|
Blue |
This instruction works in some cases. (If a given Pixel Shader does not natively support a particular instruction, using only constant values instead of variables in that instruction will sometimes cause the compiler to calculate the result itself and use that result as a mathematical constant) |
|
Yellow |
The instruction has not been confirmed to work. (All information regarding the instructions for a given pixel shader must be verified to ensure it actually works) |
|
Orange |
This instruction is broken. (The instructions may be broken because the pixel shader does not function properly, for example, ps_3_0 or because of issues with the built-in compiler, OR for other reasons) |
|
Red |
The instruction does not work. |
Texture instructions
|
Type |
Instruction |
Description |
Instruction slots |
ps_1_0 |
ps_1_1 |
ps_1_2 |
ps_1_3 |
ps_1_4 |
ps_2_0 |
ps_2_a |
ps_2_b |
ps_2_sw |
ps_3_0 |
ps_3_sw |
Note |
|
hlsl |
tex1D |
Samples a 1D texture. |
Texture: 1 |
No |
No |
No |
No |
Yes? |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex1Dbias |
Samples a 1D texture after biasing the mip level by t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex1Dgrad |
Samples a 1D texture using a gradient to select the mip level. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex1Dproj |
Samples a 1D texture using a projective divide; the texture coordinate is divided by t.w before the lookup takes place. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex1Dlod |
Samples a 1D texture with mipmaps. The mipmap LOD is specified in t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
No |
No |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex2D |
Samples a 2D texture. |
Texture: 1 |
Yes? |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex2Dbias |
Samples a 2D texture after biasing the mip level by t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex2Dgrad |
Samples a 2D texture using a gradient to select the mip level. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex2Dproj |
Samples a 2D texture using a projective divide; the texture coordinate is divided by t.w before the lookup takes place. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex2Dlod |
Samples a 2D texture with mipmaps. The mipmap LOD is specified in t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
No |
No |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex3D |
Samples a 3D texture. |
Texture: 1 |
No |
No |
No |
No |
Yes? |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex3Dbias |
Samples a 3D texture after biasing the mip level by t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex3Dgrad |
Samples a 3D texture using a gradient to select the mip level. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex3Dproj |
Samples a 3D texture using a projective divide; the texture coordinate is divided by t.w before the lookup takes place. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
tex3Dlod |
Samples a 3D texture with mipmaps. The mipmap LOD is specified in t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
No |
No |
Unknown |
Yes |
Unknown |
|
|
hlsl |
texCUBE |
Samples a cube texture. |
Texture: 1 |
No |
No |
No |
No |
Yes? |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
texCUBEbias |
Samples a cube texture after biasing the mip level by t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
texCUBEgrad |
Samples a cube texture using a gradient to select the mip level. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
texCUBEproj |
Samples a cube texture using a projective divide; the texture coordinate is divided by t.w before the lookup takes place. |
Texture: 1 |
No |
No |
No |
No |
No |
Yes |
Yes |
Yes |
Unknown |
Yes |
Unknown |
|
|
hlsl |
texCUBElod |
Samples a cube texture with mipmaps. The mipmap LOD is specified in t.w. |
Texture: 1 |
No |
No |
No |
No |
No |
No |
No |
No |
Unknown |
Yes |
Unknown |
|
Created with the Personal Edition of HelpNDoc: Keep Your Sensitive PDFs Safe with These Easy Security Measures