Bug 20986 - Incorrect tokens emitted for texgen planes in emit_statevars, slang_builtin.c
Summary: Incorrect tokens emitted for texgen planes in emit_statevars, slang_builtin.c
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 20:17 UTC by li.anye.0
Modified: 2009-04-01 06:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description li.anye.0 2009-03-31 20:17:07 UTC
If you write a shader that uses the texgen planes, you will get complaints about invalid state[0] or something like that.

I haven't cooked up a simple example program to trip this up, but it should not be necessary, because there is obviously a problem with the code.

In src/mesa/shader/slang/slang_builtin.c:
In emit_statevar:

      else if (strcmp(name, "gl_EyePlaneS") == 0) {
         tokens[0] = STATE_TEXGEN_EYE_S;
      }
      ...
      else if (strcmp(name, "gl_ObjectPlaneQ") == 0) {
         tokens[0] = STATE_TEXGEN_OBJECT_Q;
      }

This is inconsistent with _mesa_fetch_state in src/mesa/shader/prog_statevars.c.
My guess (not being familiar with the code) is that it should be

         tokens[0] = STATE_TEXGEN;
         tokens[2] = STATE_TEXGEN_EYE_S;

etc.
Comment 1 Brian Paul 2009-04-01 06:40:09 UTC
Fixed in git, commit f8dd6594bf1d597b883af44e5d724a181c1e2b53

Thanks for finding that!


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.