Stinomus's picture

Problem with glIsList on ATi cards

Could anybody shine some light on an issue with OpenTK. OpenTK.Graphics.OpenGL.GL.IsList always returns true on ATi cards in Windows 8 (have not tested Windows 7) but works correctly on nVidia cards.

Details:
Cards tested are FirePro 2260 and V7900, both using the latest FirePro drivers and both have the same problem.
Also tested on an nVidia Quadro 4000, K600 and K5000 which do NOT have this problem.

Initially I thought it could be a driver bug however a native implementation using GLboolean glIsList works fine on the ATi cards and reverting to using Int32 Tao.OpenGL.Gl.glIsList works fine on ATi cards. As far as I can tell the OpenTK version just calls into the native version so I can't really see the problem.

Here are some code samples to illustrate:

This will hang in the while loop, commenting out the while line and using the Tao version will work fine.

using System;
using OpenTK;
using OpenTK.Graphics.OpenGL;
 
namespace FPTest
{
    class TestWindow : GameWindow
    {
        public TestWindow()
            : base(640, 480, OpenTK.Graphics.GraphicsMode.Default, "testlist")
        { }
 
        uint listid = 1;
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
 
            //while (Tao.OpenGl.Gl.glIsList(listid) == 1)
            while (GL.IsList(listid))
                listid++;
 
            SwapBuffers();
        }
 
        [STAThread]
        static void Main()
        {
            using( TestWindow testWindow = new TestWindow() )
            {
                testWindow.Run(30.0);
            }
        }
    }
}

Also a native version works fine:

#include <gl\glut.h>
#include <gl\gl.h>
 
GLuint listid;
 
void init(void)
{
    glClearColor(0.0, 0.0, 0.0, 0.0);
    listid = 1;
}
 
void display(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
 
    while( glIsList(listid) )
        listid++;
 
    glFlush();
}
 
int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutInitWindowSize(250,250);
    glutInitWindowPosition(100,100);
    glutCreateWindow("listtest");
    init();
    glutDisplayFunc(display);
    glutMainLoop();
 
    return 0;
}

Any ideas? Thanks!