LWJGL Forum

Programming => OpenGL => Topic started by: Obsyd on February 24, 2012, 14:43:00

Title: Display list performance problems with OSX, but not with Windows.
Post by: Obsyd on February 24, 2012, 14:43:00
Hi there!

I have 255*125 Quads all of them are 64*32 pixels in size and textured. My problem is that in Windows I get 3000FPS, but in OSX the FPS is only 80!
I'm using a single display list to render the "map" of my quads. And I only GL_COMPILE the list once, since the 255*125 "map" is static!

Thanks for your help!
Title: Re: Display list performance problems with OSX, but not with Windows.
Post by: Obsyd on February 24, 2012, 16:06:41
Ok, I think I found out something here.

Under Windows the display list is in the vram.
Under OSX its in the system ram.
So how do I get OSX to put my display list in vram?

(I think this is a driver problem..) :(
Title: Re: Display list performance problems with OSX, but not with Windows.
Post by: Obsyd on March 19, 2012, 18:02:19
If I use DLon=1; The performance is 4-5 times better on a windows system. On OSX there is no performance gain.
What am I doing wrong? :(



if (DLon == 1) {
            if (DLbuild == 1) {

                DLtest = glGenLists(1);

                glNewList(DLtest, GL_COMPILE);
                init_textures.iso.bind();
                for (int i = 0; i <= 4800; i = i + 32) {
                    for (int j = 0; j <= 6400; j = j + 64) {

                        glBegin(GL_QUADS);
                        glTexCoord2f(0, 0);
                        glVertex2f(j, i);
                        glTexCoord2f(1, 0);
                        glVertex2f(j + init_textures.iso.getTextureWidth(), i);
                        glTexCoord2f(1, 1);
                        glVertex2f(j + init_textures.iso.getTextureWidth(), i + init_textures.iso.getTextureHeight());
                        glTexCoord2f(0, 1);
                        glVertex2f(j, i + init_textures.iso.getTextureHeight());
                        glEnd();
                    }
                }

                init_textures.iso2.bind();
                for (int i = 16; i <= 4800; i = i + 32) {
                    for (int j = 32; j <= 6400; j = j + 64) {

                        glBegin(GL_QUADS);
                        glTexCoord2f(0, 0);
                        glVertex2f(j, i);
                        glTexCoord2f(1, 0);
                        glVertex2f(j + init_textures.iso2.getTextureWidth(), i);
                        glTexCoord2f(1, 1);
                        glVertex2f(j + init_textures.iso2.getTextureWidth(), i + init_textures.iso2.getTextureHeight());
                        glTexCoord2f(0, 1);
                        glVertex2f(j, i + init_textures.iso2.getTextureHeight());
                        glEnd();
                    }
                }
                glEndList();
                System.out.println("DLcompiled");
                DLbuild = 4;
            }

            glCallList(DLtest);


        } else {

            init_textures.iso.bind();
            for (int i = 0; i <= 4800; i = i + 32) {
                for (int j = 0; j <= 6400; j = j + 64) {

                    glBegin(GL_QUADS);
                    glTexCoord2f(0, 0);
                    glVertex2f(j, i);
                    glTexCoord2f(1, 0);
                    glVertex2f(j + init_textures.iso.getTextureWidth(), i);
                    glTexCoord2f(1, 1);
                    glVertex2f(j + init_textures.iso.getTextureWidth(), i + init_textures.iso.getTextureHeight());
                    glTexCoord2f(0, 1);
                    glVertex2f(j, i + init_textures.iso.getTextureHeight());
                    glEnd();
                }
            }

            init_textures.iso2.bind();
            for (int i = 16; i <= 4800; i = i + 32) {
                for (int j = 32; j <= 6400; j = j + 64) {

                    glBegin(GL_QUADS);
                    glTexCoord2f(0, 0);
                    glVertex2f(j, i);
                    glTexCoord2f(1, 0);
                    glVertex2f(j + init_textures.iso2.getTextureWidth(), i);
                    glTexCoord2f(1, 1);
                    glVertex2f(j + init_textures.iso2.getTextureWidth(), i + init_textures.iso2.getTextureHeight());
                    glTexCoord2f(0, 1);
                    glVertex2f(j, i + init_textures.iso2.getTextureHeight());
                    glEnd();
                }
            }
        }
Title: Re: Display list performance problems with OSX, but not with Windows.
Post by: CodeBunny on March 20, 2012, 03:43:00
Dunno, is Mac using OpenGL ES or something? Display Lists are technically deprecated (though I certainly find them useful), so maybe Mac has dropped hardware accelerated support.
Title: Re: Display list performance problems with OSX, but not with Windows.
Post by: RiverC on March 26, 2012, 20:16:48
What supplements for their functionality? I'm curious to know, since they are very useful...