[fixed]COpenGLCoreTexture.h: glGenerateMipMap in GLES2

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
wolfgang
Posts: 9
Joined: Mon Jul 01, 2019 8:14 am

[fixed]COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Post by wolfgang »

Hi,

there seems to be something wrong with glGenerateMipMap in COpenGLCoreTexture.h:
In this line I get an GL_INVALID_ENUM error when I run this on linux or a real Android device. In the Android emulator I get an GL_INVALID_OPERATION . However the enum parameter is correct (GL_TEXTURE_2D).

I noticed when I remove the following ATI workaround it works on Linux and the real Android device without errors:

Code: Select all

glEnable(GL_TEXTURE_2D);    // Hack some ATI cards need this glEnable according to https://www.khronos.org/opengl/wiki/Common_Mistakes
Driver->irrGlGenerateMipmap(TextureType);
However in the emulator I still get the GL_INVALID_OPERATION error. I remember that there were no problems there with an old emulator a year ago (unfortunately I've updated Android Studio on all my machines).

As a workaround I now simply use:

Code: Select all

            #if !defined(IRR_COMPILE_GLES2_COMMON)
            glEnable(GL_TEXTURE_2D);    // Hack some ATI cards need this glEnable according to https://www.khronos.org/opengl/wiki/Common_Mistakes
            #endif
            Driver->irrGlGenerateMipmap(TextureType);
            Driver->testGLError(__LINE__);
This currently works for me (on my real devices) but I have a bad feeling about this since it still does not work in the emulator.

Any ideas?
CuteAlien
Admin
Posts: 9647
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Post by CuteAlien »

This is with newest ogl-es brranch in Irrlicht svn? mipmap handling did indeed change a lot since the version from one year ago.
Newest version should have a #ifdef IRR_OPENGL_HAS_glGenerateMipmap before it.
Sorry, I never got emulator really working with 3D. But if that line works for you I can add it to Irrlicht (seems to make sense to me).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
wolfgang
Posts: 9
Joined: Mon Jul 01, 2019 8:14 am

Re: COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Post by wolfgang »

Yes it's with the newest ogles-branch.

I think it makes sense to add it to Irrlicht.

However I don't have an explanation for this. It's just the result of trial and error.

There might also be a problem with the current emulator from Android Studio.

Btw: IRR_OPENGL_HAS_glGenerateMipmap is defined in my case and it also seems to work (at least I don't see artifacts).
CuteAlien
Admin
Posts: 9647
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Post by CuteAlien »

Changed in r6112. Thanks!
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply