mesa/src
Ian Romanick f2ef6036e8 linker: Only over-ride built-ins when a prototype has been seen
The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
(cherry picked from commit 66f4ac988d)
2011-07-20 13:36:45 -07:00
..
driclient mesa: Purge macros NEED_EVENTS and NEED_REPLIES 2010-07-01 13:07:07 -06:00
egl egl: _eglFilterArray should not allocate. 2010-12-06 15:40:37 +08:00
gallium r600g: bump shader input limits 2011-06-27 16:39:43 -07:00
glsl linker: Only over-ride built-ins when a prototype has been seen 2011-07-20 13:36:45 -07:00
glu mesa: fix mesa version string construction 2010-10-19 08:59:27 -06:00
glut scons: Revamp how to specify targets to build. 2010-11-01 13:30:22 +00:00
glw Makefiles: Don't complain if depend file to be included doesn't exist. 2010-07-21 13:19:33 -07:00
glx glx: Avoid calling __glXInitialize() in driReleaseDrawables(). 2011-07-19 23:34:55 +02:00
mapi glapi: Regenerate for GL_ARB_ES2_compatibility. 2011-02-28 13:55:34 -08:00
mesa swrast: fix depth/stencil blits when there's no colorbuffer 2011-07-11 22:59:48 +02:00
Makefile
SConscript Remove talloc from the SCons build system. 2011-02-07 15:02:39 -08:00