mesa/src
Kenneth Graunke 2826e3a000 glsl: Correctly handle function matching when there are multiple inexact matches
This is a squash cherry pick commit of:

    glsl: Find the "closest" signature when there are multiple matches.

    Previously, ir_function::matching_signature had a fatal bug: if a
    function had more than one non-exact match, it would simply return NULL.

    This occured, for example, when looking for max(uvec3, uvec3):
    - max(vec3, vec3)   -> score 1 (found first)
    - max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
    - max(uvec3, uvec3) -> score 0 (exact match...the right answer)

    This did not occur for max(ivec3, ivec3) since the second match found
    was an exact match.

    The new behavior is to return a match with the lowest score.  If there
    is an exact match, that will be returned.  Otherwise, a match with the
    least number of implicit conversions is chosen.

    Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

    NOTE: This is a candidate for the 7.10 and 7.11 branches.

    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 60eb63a855)

    glsl: Suppress warning from matching_signature change.

    gcc isn't smart enough to see that we only look at matched_score after
    we've initialized it (because match != NULL happens at the same time)
    (cherry picked from commit b043409adf)

    glsl: Reject ambiguous function calls (multiple inexact matches).

    According to the GLSL 1.20 specification, "it is a semantic error if
    there are multiple ways to apply [implicit] conversions [...] such that
    the call can be made to match multiple signatures."

    Fixes a regression caused by 60eb63a855,
    which implemented the wrong policy of finding a "closest" match.
    However, this is not a revert, since the original code failed to
    continue looking for an exact match once it found two inexact matches.

    It's OK to have multiple inexact matches if there's also an exact match.

    NOTE: This is a candidate for the 7.10 and 7.11 branches.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38971
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit 7304909d65)
2011-07-19 16:39:56 -07:00
..
driclient
egl egl_dri2: Fix compilation if udev devel files are not installed 2011-07-12 09:58:11 +02:00
gallium r600g: fix corner case checks for the queries 2011-07-18 09:00:42 -04:00
gbm targets/gbm: build pipe drivers 2011-06-24 16:43:03 +09:00
getopt getopt: Make code more portable. 2011-01-12 16:54:21 +00:00
glsl glsl: Correctly handle function matching when there are multiple inexact matches 2011-07-19 16:39:56 -07:00
glu sgi: Fix MSVC build. 2011-04-27 19:06:07 +01:00
glut scons: Revamp how to specify targets to build. 2010-11-01 13:30:22 +00:00
glw glw: Mark all extern symbols GLAPI to regain default visibility (#31294) 2011-06-20 12:31:01 -07:00
glx glx: Avoid calling __glXInitialize() in driReleaseDrawables(). 2011-07-19 23:29:16 +02:00
mapi glapi: Update specs to correctly list FramebufferTextureLayerARB as an alias of FramebufferTextureLayerEXT 2011-06-20 16:54:58 -07:00
mesa i965/gen7: Add support for gl_PointCoord. 2011-07-19 16:39:56 -07:00
Makefile
SConscript scons: Build glu. 2011-04-23 13:16:03 +01:00