Bug 15202

Summary: glGetAttribLocation not supported in display list.
Product: Mesa Reporter: francois.bertel
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description francois.bertel 2008-03-25 11:34:37 UTC
Using glGetAttribLocation() in display list does not cause immediate execution but leads to an error message about some no-op dispatch.

with git SHA1 ID 4e6c2c4f85914f89248da6414218f1fab6ae2584 (2008/03/25)

How to reproduce:

Starting with mesa/progs/demos/fslight.c

Run fslight, so far, so good
Set static GLint CoordAttrib = 1; at line 28, run fslight, so far so good.

At line 46, add MyList in the list of variables for display list ids:

static GLuint SphereList, RectList, CurList, MyList;

Also, at line 517, there is a if(CoordAttrib) statement:

Surround the following lines
 glBindAttribLocation_func(program, CoordAttrib, "coord");
 i = glGetAttribLocation_func(program, "coord");

by:
      MyList = glGenLists(1);
      glNewList(MyList, GL_COMPILE);

and:
       glEndList();

the code will look like:

if (CoordAttrib) {
      int i;

      MyList = glGenLists(1);
      glNewList(MyList, GL_COMPILE);
      glBindAttribLocation_func(program, CoordAttrib, "coord");
      i = glGetAttribLocation_func(program, "coord");
      glEndList();
[...]

Run fslight, it displays things fine but you get the following message:

Mesa: CPU vendor: GenuineIntel
Mesa: CPU name:               Intel(R) Pentium(R) 4 CPU 3.00GHz
Mesa: Mesa 7.1 DEBUG build Mar 25 2008 12:43:22
DiffusePos 8  SpecularPos 9  TexturePos -1
Mesa warning: User called no-op dispatch function (an unsupported extension function?)
Mesa warning: User called no-op dispatch function (an unsupported extension function?)
Hmmm, NVIDIA bug?
GL_RENDERER = Mesa X11
Press p to toggle between per-pixel and per-vertex lighting

The OpenGL 2.1 spec or the following extension spec
http://www.opengl.org/registry/specs/ARB/vertex_shader.txt
states that:


Modify Section 5.4, Display Lists (p. 198)

    (change second paragraph, p. 202)

    Certain commands, when called when compiling a display list, are not
    compiled into the display list but are executed immediately. These are:
    IsList,...Flush, Finish, GetAttribLocationARB, GetActiveAttribARB,
    BindAttribLocationARB, VertexAttribPointerARB,
    EnableVertexAttribArrayARB, DisableVertexAttribArrayARB as well as
    IsEnabled and all of the Get commands defined in Section 6.1.12.


This bug is the reason why the following VTK test is failing:
http://public.kitware.com/CDash/testDetails.php?test=1583889&build=35612

This VTK test does not fail with other OpenGL implementations and does not fail
with Mesa if we force VTK to not use display lists (force ImmediateModeRendering to true on the mapper).
Comment 1 Brian Paul 2008-03-25 13:06:27 UTC
Looks like we forgot to implement the display list code for a bunch of the shading language functions.  I've added the glGet/BindAttribLocation() functions to solve your problem.

It would be great to have a volunteer to fill in the rest.  It's pretty easy...

Leaving this report open until that's done.
Comment 2 francois.bertel 2008-03-25 13:27:12 UTC
Small feedback to tell that the change on dlist.c fixed the VTK test. Thanks.
Comment 3 Adam Jackson 2009-08-24 12:29:45 UTC
Mass version move, cvs -> git
Comment 4 Ian Romanick 2009-09-18 18:23:38 UTC
Since this bug seems to be fixed, I'm closing it.  There is also a piglit regression test glsl-dlist-getattriblocation for this bug.

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.