call - vs

Performs a function call to the instruction marked with the provided label.

Syntax

call l#

 

where l# is a label - vs marking the beginning of the subroutine to be called.

Remarks

Vertex shader versions 1_1 2_0 2_x 2_sw 3_0 3_sw
call x x x x x

 

This instruction does the following:

  1. Push address of the next instruction to the return address stack.
  2. Continue execution from the instruction marked by the label.

In vertex shader 2_0, nesting calls are not allowed.

In vertex shader 2_x, the nesting depth is limited by the StaticFlowControlDepth element of the D3DVSHADERCAPS2_0 structure. For more information, see GetDeviceCaps.

In vertex shader 3_0, four levels of call nesting are allowed.

Only forward calls are allowed. This means that the location of the label inside the vertex shader should be after the call instruction referencing it.

If a call instruction is invoked inside loop...endloop block, the value of the Loop Counter Register (aL) is accessible inside the subroutine.

If a subroutine is referencing the Loop Counter Register (aL) located outside of the subroutine, every instance of the call to this subroutine should be surrounded by a loop...endloop block.

Vertex Shader Instructions