if bool - vs
Microsoft DirectX 9.0 SDK Update (October 2004)

if bool - vs


Starts an if...else...endif block.

Syntax

if bool

where bool is a bool register number. See Constant Boolean Register.

Remarks

Vertex shader versions1_12_02_x2_sw3_03_sw
if boolxxxxx

If the source Boolean register in the if statement is true, the code enclosed by the if statement and the matching else is run. Otherwise, the code enclosed by the else...endif statements is run. This instruction consumes one instruction slot.

if blocks can be nested.

An if block cannot straddle a loop block.

Example

This instruction provides conditional static flow control.

defb b2, TRUE

...

if b2
// Instructions to run if b2 is nonzero

else
// Instructions to run otherwise

endif

Related Topics



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