sincos - ps
Microsoft DirectX 9.0 SDK Update (October 2004)

sincos - ps


Computes sine and cosine, in radians.

Syntax

ps_2_0 and ps_2_x

sincos dst.{x|y|xy}, src0.{x|y|z|w}, src1, src2

Where:

ps_3_0

sincos dst.{x|y|xy}, src0.{x|y|z|w}

Where:

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
sincosxxxxx

ps_2_0 and ps_2_x

For ps_2_0 and ps_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 ps_2_0 and ps_2_x, the instruction operates as follows (V = the scalar value from src0 with a replicate swizzle):

ps_3_0

For ps_3_0, sincos can be used with predication without any restriction. See Predicate Register.

For ps_3_0, the instruction operates as follows (V = the scalar value from src0 with a replicate swizzle):

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


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.