|
|
Syntax
sincos dst, src0, src1, src2
where
dst is the destination register. Should be a temporary register.
src0 is a source register that provides the input angle. The angle must be within [-Pi, +Pi].
src1 is a source register. Must be a constant register. For ps_3_0 or above, this parameter is not strictly needed, as the component values are provided.
src2 is a source register. Must be a constant register. For ps_3_0 or above, this parameter is not strictly needed, as the component values are provided.
Source register rules:
src0.w is an angle measured in radians between -Pi and +Pi.
src1 = (-1.0f/(7!*128), -1.0f/(6!*64), 1/(4!*16), 1/(5!*32) ).
src2 = (-1.0f/(3!*8), -1.0f/(2!*8), 1, 0.5f).
These values are defined in the following macros: D3DSINCOSCONST1 and D3DSINCOSCONST2.
Destination register rules:
dest.x = cos(src1.selected_channel), dest.y = sin(src1.selected_channel), dest.z is undefined after the instruction.
dest should not be the same register as src1.
Only .x and .y are allowed to be in the destination write mask.
The maximum absolute error is 0.002.
This is a macro instruction, which takes eight instruction slots.
If application wants to compute sincos for an arbitrary angle, then the angle could be mapped to the range -Pi to +Pi by using the following macro (r0.x holds the original angle).
|
|