Computes sine and cosine, in radians.
sincos dst.{x|y|xy}, src0.{x|y|z|w}, src1, src2 |
---|
Where:
sincos dst.{x|y|xy}, src0.{x|y|z|w} |
---|
Where:
Vertex shader versions | 1_1 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|
sincos | x | x | x | x | x |
For vs_2_0 and vs_2_x, sincos can be used with predication, but with one restriction to the swizzle of the Predicate Register (p0): only replicate swizzle (.x | .y | .z | .w) is allowed.
For vs_2_0 and vs_2_x, the instruction operates as follows: (V = the scalar value from src0 with a replicate swizzle):
dest.x = cos( V ) dest.y is undefined when the instruction completes dest.z is undefined when the instruction completes dest.w is not touched by the instruction
dest.x is undefined when the instruction completes dest.y = sin( V ) dest.z is undefined when the instruction completes dest.w is not touched by the instruction
dest.x = cos( V ) dest.y = sin( V ) dest.z is undefined when the instruction completes dest.w is not touched by the instruction
For vs_3_0, sincos can be used with predication without any restriction. See Predicate Register.
For vs_3_0, the instruction operates as follows: (V = the scalar value from src0 with a replicate swizzle)
dest.x = cos( V ) dest.y is not touched by the instruction dest.z is not touched by the instruction dest.w is not touched by the instruction
dest.x is not touched by the instruction dest.y = sin( V ) dest.z is not touched by the instruction dest.w is not touched by the instruction
dest.x = cos( V ) dest.y = sin( V ) dest.z is not touched by the instruction dest.w is not touched by the instruction
The application can map an arbitrary angle (in radians) to the range [-pi, +pi] using the following shader pseudocode:
def c0, pi, 0.5, 2*pi, 1/(2*pi) mad r0.x, input_angle, c0.w, c0.y frc r0.x, r0.x mad r0.x, r0.x, c0.z, -c0.x