Page 1 of 1

[fixed]COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Posted: Thu May 28, 2020 3:13 pm
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?

Re: COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Posted: Thu May 28, 2020 7:10 pm
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).

Re: COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Posted: Fri May 29, 2020 11:22 am
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).

Re: COpenGLCoreTexture.h: glGenerateMipMap in GLES2

Posted: Wed Jun 10, 2020 8:58 pm
by CuteAlien
Changed in r6112. Thanks!