?/TD>
Microsoft DirectX 9.0

texldp (Pixel Shader)


Projected texture load instruction. This instruction divides the input texture coordinate by the fourth element (.a or .w) just before sampling.

Syntax

texldp dst[_pp], src0, src1

where

For the set of restrictions when using texldp, see the texld instruction.

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
texldpxxxxx

texldp performs projection on the coordinates read from src0 before performing the sample. Each texture coordinate is divided src0.w, then the texture is sampled. After the texldp, the contents of src0 are unaffected (unless dst is the same register). The D3DTTFF_PROJECTED texture-transform flag was retired in ps_1_4.

An alternative to using texldp is to manually perform projection in the shader, to get post-projection texture coordinate perturbation. For example:

rcp r0, t0.w     // Do projective divide on t0 texcoords.
mul r1, t0, r0.w // Complete it with multiply.
add r1, r1, r2   // Perturb post-projected coordinates by r2.
texld r0, r1, s0 // Sample at those coordinates.

Performing the division in shader code is usually slower than when performed by the texldp instruction, so avoid such additional math when possible.

Instruction Information

Minimum operating systemWindows 98


© 2002 Microsoft Corporation. All rights reserved.