if pred - ps

Start of an if bool - ps...else - ps...endif - ps block, with the condition taken from the content of the predicate register.

Syntax

if [!]pred.replicateSwizzle

Where:

Remarks

Pixel shader versions 1_1 1_2 1_3 1_4 2_0 2_x 2_sw 3_0 3_sw
if_pred x x x x

This instruction is used to skip a block of code, based on a channel of the predicate register. Each if_pred block must end with an else - ps or endif - ps instruction.

Restrictions include:

if_pred blocks can be nested. This counts to the total dynamic nesting depth along with if_comp blocks.

An if_pred block cannot straddle a loop block; it should either be completely inside it or surround it.