Bug 29186 - [glsl2] fail to override built-in functions
Summary: [glsl2] fail to override built-in functions
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 18:49 UTC by Gordon Jin
Modified: 2010-08-09 17:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Gordon Jin 2010-07-20 18:49:50 UTC
GLSL spec says: "User code can replace built-in functions with their own if they choose, by simply re-declaring and defining the same name and argument list."

But piglit/tests/glslparsertest/shaders/CorrectBuiltInOveride.frag fails when defining 'radians' (a built-in function) with below failure: 
error: function `radians' redefined

This happens with mesa glsl2 branch, while passes with master branch.

It seems the glsl2 ir reader doesn't consider built-in functions when processing redefining error.
Comment 1 Gordon Jin 2010-07-20 19:48:55 UTC
just seeing this has been mentioned in src/glsl/TODO as well:

- Handle over-riding built-in functions
Comment 2 Kenneth Graunke 2010-07-30 09:00:21 UTC
idr fixed this with his linker changes - probably in d5be2acae (linker: Link built-in functions instead of including them in every shader).  CorrectBuiltInOveride.frag now passes on Ironlake.
Comment 3 Gordon Jin 2010-08-09 17:46:25 UTC
verified


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.