?/TD>
Microsoft DirectX 9.0

if (Pixel Shader)


Start of an if...else...endif block.

Syntax

if boolRegister

Where:

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
ifxxxx

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.

An if block can be nested.

An if block cannot straddle a loop block.

Example

This instruction provides conditional static flow control.

defb b3, true

if b3
// Instructions to run if b3 is nonzero.
else
// Instructions to run otherwise.
endif

Instruction Information

Minimum operating systemWindows 98

Related Topics



© 2002 Microsoft Corporation. All rights reserved.