[Mesa-dev] [Bug 25994] [GM45][GLSL] 'return' statement in vertex shader unsupported

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Sep 13 13:15:54 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=25994

Ian Romanick <idr at freedesktop.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #15 from Ian Romanick <idr at freedesktop.org> 2010-09-13 13:15:53 PDT ---
commit 4de7a3b76add1940f7316253a619c3728025d9db
Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Sep 13 11:05:05 2010 -0700

    i965: Request that returns be lowered in shader main

    Fixes piglit tests glsl-vs-main-return and glsl-fs-main-return.

commit 87708e8c90220cc1997cef9de9b394c04d952be9
Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Tue Sep 7 02:15:26 2010 +0200

    glsl: call ir_lower_jumps according to compiler options

commit 3361cbac2a883818efeb2b3e27405eeefce60f63
Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Tue Sep 7 00:24:08 2010 +0200

    glsl: add continue/break/return unification/elimination pass (v2)

    Changes in v2:
    - Base class renamed to ir_control_flow_visitor
    - Tried to comply with coding style

    This is a new pass that supersedes ir_if_return and "lowers" jumps
    to if/else structures.

    Currently it causes no regressions on softpipe and nv40, but I'm not sure
    whether the piglit glsl tests are thorough enough, so consider this
    experimental.

    It can be asked to:
    1. Pull jumps out of ifs where possible
    2. Remove all "continue"s, replacing them with an "execute flag"
    3. Replace all "break" with a single conditional one at the end of the loop
    4. Replace all "return"s with a single return at the end of the function,
       for the main function and/or other functions

    This gives several great benefits:
    1. All functions can be inlined after this pass
    2. nv40 and other pre-DX10 chips without "continue" can be supported
    3. nv30 and other pre-DX10 chips with no control flow at all are better
supp

    Note that for full effect we should also teach the unroller to unroll
    loops with a fixed maximum number of iterations but with the canonical
    conditional "break" that this pass will insert if asked to.

    Continues are lowered by adding a per-loop "execute flag", initialized to
    TRUE, that when cleared inhibits all execution until the end of the loop.

    Breaks are lowered to continues, plus setting a "break flag" that is
checked
    at the end of the loop, and trigger the unique "break".

    Returns are lowered to breaks/continues, plus adding a "return flag" that
    causes loops to break again out of their enclosing loops until all the
    loops are exited: then the "execute flag" logic will ignore everything
    until the end of the function.

    Note that "continue" and "return" can also be implemented by adding
    a dummy loop and using break.
    However, this is bad for hardware with limited nesting depth, and
    prevents further optimization, and thus is not currently performed.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the mesa-dev mailing list