sgn - vs

Computes the sign of the input.

Syntax

sgn dst, src0, src1, src2

 

where

  • dst is the destination register.
  • src0 is a source register.
  • src1 is a temporary register that holds intermediate results. Following execution, contents are undefined.
  • src2 is a temporary register that holds intermediate results. Following execution, contents are undefined.

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;
}


src1 and src2 must be different Temporary Registers.

 

 

Community Additions

ADD
Show:
© 2014 Microsoft