?/TD> |
Microsoft DirectX 9.0 |
Computes sine and cosine, in radians. The x-component of result contains cos(x). The y component contains sin(x). The src1 register needs to have a replicate swizzle to indicate which channel is used.
sincos dst, src0, src1, src2 |
---|
where
Pixel shader versions | 1_1 | 1_2 | 1_3 | 1_4 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|---|---|---|
sincos | x | x | x | x | x |
Source register rules:
These values are defined in the following macros: D3DSINCOSCONST1 and D3DSINCOSCONST2.
Destination register rules:
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).
def c0, Pi, 0.5f, 2*Pi, 1/(2*Pi) mad r0.x, r.x, c0.w, c0.y frc r0.x, r0.x mad r0.x, r0.x, c0.z, -c0.x
Minimum operating system | Windows 98 |
---|