Export (0) Print
Expand All

crs - ps

Computes a cross product using the right-hand rule.

Syntax

crs dst, src0, src1

 

where

  • dst is the destination register.
  • src0 is a source register.
  • src1 is a source register.

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
crsxxxxx

 

This instruction works as shown here.



dest.x = src0.y * src1.z - src0.z * src1.y;
dest.y = src0.z * src1.x - src0.x * src1.z;
dest.z = src0.x * src1.y - src0.y * src1.x;


Some restrictions on use:

  • src0 cannot be the same register as dest.
  • src1 cannot be the same register as dest.
  • src0 cannot have any swizzle other than the default swizzle (.xyzw).
  • src1 cannot have any swizzle other than the default swizzle (.xyzw).
  • dest has to have exactly one of the following seven masks: .x | .y | .z | .xy | .xz | .yz | .xyz.
  • dest must be a temporary register.
  • dest must not be the same register as src0 or src1

 

 

Community Additions

ADD
Show:
© 2014 Microsoft