I have a glDrawElements call in a large library of mine that produces INVALID_OPERATION on macOS and a segfault in Ubuntu 16.04. Additionally, if I remove some of the glGetError checks, it no longer produces either result in either OS. It works partially: I should be seeing lots of little squares flashing colors and one big white square, all rotating around the Y axis, but I only get a big square flashing colors. I find this to be very strange.
Here’s the library: https://github.com/TechShroom/EmergencyLanding/tree/feature/sound (make sure you have the branch linked)
Use ./gradlew run
to run it. If you’re not on OSX you need to remove the -XstartOnFirstThread
from the argument list at the bottom.
The glDrawElements call that is failing: https://github.com/TechShroom/EmergencyLanding/blob/feature/sound/src/main/java/com/techshroom/emergencylanding/library/lwjgl/render/VBAO.java#L337
Notice how it is followed by something that checks the debug level. If you remove the -Del.debug.level=5
argument from the arguments list, the problem will stop happening. It occurs with it present. If anyone can even give me a lead on where it might be, I’d be extremely grateful.