#217 glCallLists calls lists twice

v3.0.0
closed-fixed
GL (74)
5
2010-02-25
2009-07-29
Luca Bruno
No

Hello,
I'm using pyopengl 3.0.0~c1 from debian and mesa 7.6 from git. I'm almost pretty sure that glCallLists ([1]) calls the list 1 twice, so it happens for more than one list. Reproduce as follows:
1. glRenderMode(GL_SELECT)
2. ... glCallLists([1])
3. glRenderMode(GL_RENDER)
If the list 1 pushed only one name, you get two hits. This doesn't happen if you glCallList(1), you only get one hit as expected. I'm currently doing (glCallList(list) for list in lists) instead of glCallLists as temporarly workaround. I don't know if this happens with C++ directly, couldn't test so I've reported it here.

Discussion

  • I can't replicate this failure condition. I am using this code, on an Ubuntu 3.0.1 Jaunty Linux Box with current BZR head of PyOpenGL:

    def test_glCallLists_twice( self ):
    """SF#2829309 report that glCallLists doubles operation"""
    l = glGenLists(1)
    try:
    glEnd()
    except error.GLerror, err:
    pass
    glSelectBuffer( 23 )
    glRenderMode( GL_SELECT )
    glNewList( l, GL_COMPILE )
    glPushName( 222 )
    glEndList()
    depth = glGetIntegerv( GL_NAME_STACK_DEPTH )
    assert depth == (0,), depth # shouldn't have added in compile mode
    glCallLists( [l] )
    depth = glGetIntegerv( GL_NAME_STACK_DEPTH )
    assert depth == (1,), depth # should have a single record
    glCallLists( [l] )
    depth = glGetIntegerv( GL_NAME_STACK_DEPTH )
    assert depth == (2,), depth # should have a second (identical) record
    glPopName()
    glPopName()
    glRenderMode( GL_RENDER )

    which test passes. Please provide a test that fails on your platform so I can test whether we're looking at a bug that was fixed in the meantime or an error in usage or a subtle corner case.

     
  • Luca Bruno
    Luca Bruno
    2009-07-30

    I rectify, it happens with GL_COMPILE_AND_EXECUTE (not necessary other lists) and glCallLists must be in a list to call other lists:

    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    gluPerspective(40.0, 1.0, 1.0, 10.0)
    glTranslatef (0, 0, -3)

    glMatrixMode (GL_MODELVIEW)
    glLoadIdentity ()
    glNewList(1, GL_COMPILE_AND_EXECUTE)
    glInitNames ()
    glCallLists([2]) # replace with gCallList(2)
    glEndList ()

    glNewList(2, GL_COMPILE)
    glPushName (1)
    glBegin (GL_POINTS)
    glVertex3f (0, 0, 0)
    glEnd ()
    glPopName ()
    glEndList ()

    glSelectBuffer (100)
    glRenderMode (GL_SELECT)
    glCallList(1)
    print glRenderMode (GL_RENDER)

     
  • Hmm, I'm seeing exactly the same behaviour from both call-types, namely I'm not getting any records at all (just ([],) don't have time to investigate why just now.

     
  • Not getting records was just because of interference from previous test case for the same problem (duh!) With current test case I pass on both Win32 and Linux AMD64 (two different Linux AMD64 machines, with ATI and nVidia cards). Test case is in the 3.0.1a2 release if you wish to download that and test on your machine (tests/test_core.py script).

     
  • Any news as to whether the test case fails on your machine? I haven't been able to reproduce yet.

     
  • Luca Bruno
    Luca Bruno
    2010-02-22

    I've already added a test case which fails on my platform, I don't know why you are using another test made by you which it's clearly different than mine, most of all because I said it only happens in COMPILE AND EXECUTE.

     
  • Luca Bruno
    Luca Bruno
    2010-02-22

    I'm sorry for the reply, I'm not used to read comments from the bottom up. Apologies.
    If you think it can be closed, feel free to close it. I have no time to investigate on it back again. In the worst case, I'll reopen it. Thanks for your help.

     
    • status: open --> closed-fixed
     
  • Okay, closing for now.