From 3da84a987415e3ecf62a1aa730113cc037e196e9 Mon Sep 17 00:00:00 2001 From: gohai Date: Sun, 22 Apr 2018 20:43:54 -0700 Subject: [PATCH] ARM Mali: Don't use GL_MULTISAMPLE or GL_POLYGON_SMOOTH on ES Fixes: GLDebugEvent[ id 0x32 type Error severity High: dangerous undefined behavior source GL API msg Error:glEnable:: is not one of the accepted values when 1524184964512 source 3.1 (ES profile, arb, debug, compat[ES2, ES3, ES31], FBO, hardware) - OpenGL ES 3.1 v1.r17p0-01rel0.a881d28363cdb20f0017ed13c980967e - hash 0x1f928e9] [2]: jogamp.opengl.GLDebugMessageHandler$StdErrGLDebugListener.messageSent(GLDebugMessageHandler.java:347) [3]: jogamp.opengl.GLDebugMessageHandler.sendMessage(GLDebugMessageHandler.java:332) [4]: jogamp.opengl.GLDebugMessageHandler.glDebugMessageARB(GLDebugMessageHandler.java:358) [5]: jogamp.opengl.es3.GLES3Impl.dispatch_glEnable1(Native Method) [6]: jogamp.opengl.es3.GLES3Impl.glEnable(GLES3Impl.java:734) [7]: com.jogamp.opengl.DebugGLES3.glEnable(DebugGLES3.java:2121) [8]: processing.opengl.PJOGL.enable(PJOGL.java:1068) [9]: processing.opengl.PGraphicsOpenGL.setGLSettings(PGraphicsOpenGL.java:6784) [10]: processing.opengl.PGraphicsOpenGL.checkSettings(PGraphicsOpenGL.java:6740) [11]: processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1463) [12]: processing.core.PApplet.handleDraw(PApplet.java:2388) [13]: processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866) [14]: jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692) [15]: jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674) [16]: jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443) [17]: jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293) [18]: jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147) [19]: com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759) [20]: com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81) [21]: com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452) [22]: com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178) [23]: java.util.TimerThread.mainLoop(Timer.java:555) [24]: java.util.TimerThread.run(Timer.java:505) --- core/src/processing/opengl/PGraphicsOpenGL.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index f4cd69ec8..0835b263a 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -1561,9 +1561,8 @@ public class PGraphicsOpenGL extends PGraphics { } pgl.depthFunc(PGL.LEQUAL); - if (OPENGL_RENDERER.equals("VideoCore IV HW")) { - // Broadcom's VC IV driver is unhappy with either of these - // ignore for now + if (pgl.isES()) { + // neither GL_MULTISAMPLE nor GL_POLYGON_SMOOTH are part of GLES2 or GLES3 } else if (smooth < 1) { pgl.disable(PGL.MULTISAMPLE); } else if (1 <= smooth) { @@ -6775,16 +6774,14 @@ public class PGraphicsOpenGL extends PGraphics { // quality = temp; // } } - if (OPENGL_RENDERER.equals("VideoCore IV HW")) { - // Broadcom's VC IV driver is unhappy with either of these - // ignore for now + if (pgl.isES()) { + // neither GL_MULTISAMPLE nor GL_POLYGON_SMOOTH are part of GLES2 or GLES3 } else if (smooth < 1) { pgl.disable(PGL.MULTISAMPLE); } else if (1 <= smooth) { pgl.enable(PGL.MULTISAMPLE); } - // work around runtime exceptions in Broadcom's VC IV driver - if (false == OPENGL_RENDERER.equals("VideoCore IV HW")) { + if (!pgl.isES()) { pgl.disable(PGL.POLYGON_SMOOTH); }