?/TD>
Microsoft DirectX 9.0

sgn (Vertex Shader)


Computes the sign of the input.

Syntax

sgn dst, src0, src1, src2

where

Remarks

Vertex shader versions1_12_02_x2_sw3_03_sw
sgnxxxxx

This instruction works as shown below.

for each component in src0
{
   if (src0.component <  0) 
       dest.component = -1; 
   else
       if (src0.component == 0) 
           dest.component = 0; 
       else 
           dest.component = 1;
}

This is a macro instruction, which takes three instruction slots.

src1, and src2 should be different temporary registers.

Instruction Information

Minimum operating systemWindows 98


© 2002 Microsoft Corporation. All rights reserved.