breakc (sm4 - asm)

Conditionally moves the point of execution to the instruction after the next endloop or endswitch.

breakc{_z|_nz} src0.select_component
Item Description
src0
[in] The component on which to test the condition.

Remarks

The token format contains the offset of the corresponding endloop instruction in the Shader as a convenience.

The following example shows thebreakc instruction.

                loop
                    // example of termination condition
                    breakc_z  r0.x // break if all bits in r0.x are 0
                    breakc_nz r1.x // break if any bit in r1.x is nonzero
                    ...
                endloop

This instruction must appear within a loop/endloop or switch/endswitch.

The 32-bit register supplied by src0 is tested at a bit level. If any bit is nonzero, breakc_nz will perform the break. If all bits are zero, breakc_z will perform the break.

This instruction applies to the following shader stages:

Vertex Shader Geometry Shader Pixel Shader
x x x

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 5 yes
Shader Model 4.1 yes
Shader Model 4 yes
Shader Model 3 (DirectX HLSL) no
Shader Model 2 (DirectX HLSL) no
Shader Model 1 (DirectX HLSL) no

Shader Model 4 Assembly (DirectX HLSL)