Flow Control Nesting Limits

Vertex shader flow control instructions have two special restrictions. Nesting depths restrict the number of instructions that can be called inside of each other. In addition, each instruction has an instruction slot count that applies against the maximum number of instruction that a shader can support.

Note  When you use the *_4_0_level_9_x HLSL shader profiles, you implicitly use of the Shader Model 2.x profiles to support Direct3D 9 capable hardware. Shader Model 2.x profiles support more limited flow control behavior than the Shader Model 4.x and later profiles.

Depth Count per Instruction for vs_2_0

Each instruction counts against one or more nesting depth limits. This table shows the depth count that each instruction adds or subtracts from the existing depth:

InstructionStatic nestingDynamic nestingloop/rep nestingcall nestingStatic flow count
if bool - vs 00001
if_comp - vs n/an/an/an/an/a
if pred - vs n/an/an/an/an/a
else - vs 00001(if bool - vs only)
endif - vs -10000
rep - vs 00101
endrep - vs 00-100
loop - vs 00101
endloop - vs 00-100
break - vs n/an/an/an/an/a
break_comp - vs n/an/an/an/an/a
breakp - vs n/an/an/an/an/a
call - vs 00011
callnz bool - vs 00011
callnz pred - vs n/an/an/an/an/a
ret - vs 000-10
setp_comp - vs n/an/an/an/an/a

 

Nesting Depth

Nesting depth define how many instructions can be called inside of each other. Each type of instruction has one or more nesting limits:

Instruction TypeMaximum
Static nestingOnly limited by the static flow count
Dynamic nestingn/a
loop/rep nesting1
call nesting1
Static flow count16

 

Depth Count per Instruction for vs_2_x

Each instruction counts against one or more nesting depth limits. This table shows the depth count that each instruction adds or subtracts from the existing depth:

InstructionStatic nestingDynamic nestingloop/rep nestingcall nestingStatic flow count
if bool - vs 10001
if_comp - vs 01000
if pred - vs 01000
else - vs 00001(if bool - vs only)
endif - vs -1(if bool - vs)-1(if pred - vs or if_comp - vs)000
rep - vs 00101
endrep - vs 00-100
loop - vs 00101
endloop - vs 00-100
break - vs 00000
break_comp - vs 01, -1000
breakp - vs 00000
call - vs 00011
callnz bool - vs 00011
callnz pred - vs 01010
ret - vs 0-1 (callnz pred - vs)0-10
setp_comp - vs 00000

 

Nesting Depth

Nesting depth define how many instructions can be called inside of each other. Each type of instruction has one or more nesting limits:

Instruction TypeMaximum
Static nestingOnly limited by the static flow count
Dynamic nesting0 or 24, see D3DCAPS9.VS20Caps.DynamicFlowControlDepth
loop/rep nesting1 to 4, see D3DCAPS9.VS20Caps.StaticFlowControlDepth
call nesting1 to 4, see D3DCAPS9.VS20Caps.StaticFlowControlDepth (independent of loop/rep limit)
Static flow count16

 

Depth Count per Instruction for vs_2_sw

Each instruction counts against one or more nesting depth limits. This table shows the depth count that each instruction adds or subtracts from the existing depth:

InstructionStatic nestingDynamic nestingloop/rep nestingcall nestingStatic flow count
if bool - vs 1000n/a
if_comp - vs 0100n/a
if pred - vs 0100n/a
else - vs 0000n/a
endif - vs -1(if bool - vs)-1(if pred - vs or if_comp - vs)00n/a
rep - vs 0010n/a
endrep - vs 00-10n/a
loop - vs 0010n/a
endloop - vs 00-10n/a
break - vs 0000n/a
break_comp - vs 01, -100n/a
breakp - vs 0000n/a
call - vs 0001n/a
callnz bool - vs 0001n/a
callnz pred - vs 0101n/a
ret - vs 0-1 (callnz pred - vs)0-1n/a
setp_comp - vs 0000n/a

 

Nesting Depth

Nesting depth define how many instructions can be called inside of each other. Each type of instruction has one or more nesting limits:

Instruction TypeMaximum
Static nesting24
Dynamic nesting24
loop/rep nesting4
call nesting4
Static flow countNo limit

 

Depth Count per Instruction for vs_3_0

Each instruction counts against one or more nesting depth limits. This table shows the depth count that each instruction adds or subtracts from the existing depth:

InstructionStatic nestingDynamic nestingloop/rep nestingcall nestingStatic flow count
if bool - vs 1000n/a
if_comp - vs 0100n/a
if pred - vs 0100n/a
else - vs 0000n/a
endif - vs -1(if bool - vs)-1(if pred - vs or if_comp - vs)00n/a
rep - vs 0010n/a
endrep - vs 00-10n/a
loop - vs 0010n/a
endloop - vs 00-10n/a
break - vs 0000n/a
break_comp - vs 01, -100n/a
breakp - vs 0000n/a
call - vs 0001n/a
callnz bool - vs 0001n/a
callnz pred - vs 0101n/a
ret - vs 0-1 (callnz pred - vs)0-1n/a
setp_comp - vs 0000n/a

 

Nesting Depth

Nesting depth define how many instructions can be called inside of each other. Each type of instruction has one or more nesting limits:

Instruction TypeMaximum
Static nesting24
Dynamic nesting24
loop/rep nesting4
call nesting4
Static flow countNo limit

 

Depth Count per Instruction for vs_3_sw

Each instruction counts against one or more nesting depth limits. This table shows the depth count that each instruction adds or subtracts from the existing depth:

InstructionStatic nestingDynamic nestingloop/rep nestingcall nestingStatic flow count
if bool - vs 1000n/a
if_comp - vs 0100n/a
if pred - vs 0100n/a
else - vs 0000n/a
endif - vs -1(if bool - vs)-1(if pred - vs or if_comp - vs)00n/a
rep - vs 0010n/a
endrep - vs 00-10n/a
loop - vs 0010n/a
endloop - vs 00-10n/a
break - vs 0000n/a
break_comp - vs 01, -100n/a
breakp - vs 0000n/a
call - vs 0001n/a
callnz bool - vs 0001n/a
callnz pred - vs 0101n/a
ret - vs 0-1 (callnz pred - vs)0-1n/a
setp_comp - vs 0000n/a

 

Nesting Depth

Nesting depth define how many instructions can be called inside of each other. Each type of instruction has one or more nesting limits:

Instruction TypeMaximum
Static nesting24
Dynamic nesting24
loop/rep nesting4
call nesting4
Static flow countNo limit

 

 

 

Community Additions

ADD
Show:
© 2014 Microsoft