Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ret (sm4 - asm)
Collapse the table of content
Expand the table of content

ret (sm4 - asm)

Return statement.

ret

 

Remarks

If within a subroutine, return to the instruction after the call. If not inside a subroutine, terminate program execution.

The following example shows how to use this instruction.

 
               ...
                call l3
                ...
                ret
                label l3
                    ...
                ret


Restrictions

  • ret can appear anywhere in a program, any number of times.
  • If a label instruction appears in a Shader, it must be preceded by a ret command that is not nested in any flow control statements.
  • If there are subroutines in a Shader, the last instruction in the Shader must be a ret.

This instruction applies to the following shader stages:

Vertex ShaderGeometry ShaderPixel Shader
xxx

 

Minimum Shader Model

This function is supported in the following shader models.

Shader ModelSupported
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

 

 

 

Community Additions

ADD
Show:
© 2015 Microsoft