Takes the address of an instruction from the return address stack and continues execution from it. In the case of the main function, this instruction stops shader execution.
ret |
---|
Pixel shader versions | 1_1 | 1_2 | 1_3 | 1_4 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|---|---|---|
ret | x | x | x | x |
This instruction takes the address of an instruction from the return address stack and continues execution from it. In the case of the main function, this instruction stops shader execution.
The ret instruction consumes one vertex shader instruction slot.
If a shader contains no subroutines, using ret at the end of the main program is optional.
Multiple return statements are not permitted in the main program or in any subroutine, the first return statement is treated as the end of the main program or subroutine.