We try to integrate MetalGL into our OpenGL ES 2.0 based project. After MetalGL installation from README.md, project is build well, but it crashes at runtime with glDrawArrays(..),
[***MetalGL ERROR***] Unknown GLenum value (0x84BF)
[***MetalGL ERROR***] GL_INVALID_ENUM. glDrawArrays(): UNKNOWN_GLENUM is not a valid a texture unit value. MetalGL supports a maximum of 16 texture units.
If I disable glDrawArrays, then I see MetalGL logo on screen.
We’re considering using MetalGL licence, but first we need to run our app successfully.
Is the OpenGL enumerant 0x84BF something you are using from a custom extension?
If not, can you provide further info about the environment you are running (iOS version, device, etc).
Are you able to ZIP up an Xcode project that demonstrates the issue, post it to a site like Dropbox, and then post a link here? We can then have a look at it directly. If your project is not something you want to post in public, once you have posted the ZIP to a site like Dropbox, you can email the private link to email@example.com.
Thanks for sending us your stack trace of this error.
It looks like you’re hitting an issue that arises when a GLSL shader includes a texture sampler that has not been initialized by the application code (i.e.- the app does not set the sampler uniform value). The missing sampler value is not necessarily an error, as it can make sense with shaders that follow selective execution paths. Unfortunately, the current public release of MetalGL does not assume a default sampler value, when the sampler uniform value is not explicitly set by the app, and this is what is causing the error.
The pre-release version of MetalGLavailable here fixes this issue. Please download it and give it a try. This fix should be in an upcoming production release of MetalGL by the end of this month.