ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
682 stars 154 forks source link

Shader reloading issue #361

Open Sisah2 opened 2 years ago

Sisah2 commented 2 years ago

Hello, there is bug in openmw that making me crazy. There is in game option to change max lights count. When its changed openmw generate new, slightly modified shader source code and should recompile and relink them. All works fine on pc with desktop open gl. But with gl4es changing light limit broke shaders (it then use ffp, or objects simply disapear) and if light limit is changed more times aplication just crash. Any idea how to fix this?

Sisah2 commented 2 years ago

Also if i start game with 16 lights limit, then change it to something different it breake them, but changing it back to 16 seems to fix it again. When changing it it triger shaderconv can see the sources with LIBGL_DBGSHADERCONV, but no compilation errors happen.

ptitSeb commented 2 years ago

No, I don't see why it would crash / break. Shaders should be recompiled. I suppose there is an issue in gl4es with a Program that was previously successfully linked beeing changed are re-linked.

Sisah2 commented 2 years ago

So if program is sucesfully compiled and linked, then its source is changed it need only recompile? Not link again? It seems to call gl4es_glLinkProgram when recompilation is trigered.

ptitSeb commented 2 years ago

No, you need to link again.

What I mean is gl4es may have some bug in the re-linking phase, because gl4es does many think when a program links successfully (grabbing all attributes and uniform from that program mainly).