[Mesa-dev] [PATCH 06/11] glsl: Refactor logic for determining whether to lower return statements.

Paul Berry stereotype441 at gmail.com
Thu Jul 7 09:56:56 PDT 2011


On 7 July 2011 01:16, Kenneth Graunke <kenneth at whitecape.org> wrote:
> What exactly is the difference between lowering returns in "main" and
> lowering them in other subroutines?  void vs. non-void is definitely
> different, but I don't see why main is special.  Looking at the code, it
> doesn't actually seem to use lower_main_return anywhere...

There's no difference in how returns are lowered in "main" and in
subroutines.  The difference is in whether or not we lower returns.
For instance, when _mesa_ir_link_shader() calls do_lower_jumps(), it
always asks it to lower returns in subroutines (presumably to
facilitate inlining), but it only asks it to lower returns in main if
options->EmitNoMainReturn is true.


More information about the mesa-dev mailing list