Summary: |
Link time error when using multiple builtin functions |
Product: |
Mesa
|
Reporter: |
Niels Ole Salscheider <niels_ole> |
Component: |
glsl-compiler | Assignee: |
Kenneth Graunke <kenneth> |
Status: |
RESOLVED
FIXED
|
QA Contact: |
Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: |
normal
|
|
|
Priority: |
medium
|
CC: |
niels_ole
|
Version: |
git | |
|
Hardware: |
Other | |
|
OS: |
All | |
|
Whiteboard: |
|
i915 platform:
|
|
i915 features:
|
|
Attachments: |
Simple test case
|
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.
Created attachment 128570 [details] Simple test case When using multiple builtin functions, linking of a shader can fail if temporary variables of the GLSL compiler collide. builtin_builder::binop creates variables named "x" and "y" for the parameters of builtin functions. Later, ir_call::generate_inline inlines the call to the builtins. It clones the variables (without changing the name) and assigns the function inputs to them. This can cause a collision of variable names, e. g. when using multiple builtin functions with parameters of different types. The attached test case can be used to reproduce the problem. I can work around the problem by adding a sequence number and possibly a prefix to the variable names but I am not sure if that is the correct solution. Thanks to imirkin and robclark for helping me to figure this out on IRC.