From cdf38b01fc4b632554c6400239ca5cdca1fe13d9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 3 Oct 2013 20:21:23 +0200 Subject: Bug 818: Enable new quirk GLSLNonCompliant on OSX < 10.7 w/ NV GPU; GLJPanel: Don't use GLSL flip if quirk GLSLNonCompliant is present. --- src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index dae631f2a..fb39143b4 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -93,6 +93,7 @@ import com.jogamp.common.util.awt.AWTEDTExecutor; import com.jogamp.nativewindow.awt.AWTPrintLifecycle; import com.jogamp.nativewindow.awt.AWTWindowClosingProtocol; import com.jogamp.opengl.FBObject; +import com.jogamp.opengl.GLRendererQuirks; import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes; import com.jogamp.opengl.util.GLPixelBuffer.SingletonGLPixelBufferProvider; import com.jogamp.opengl.util.GLDrawableUtil; @@ -1296,7 +1297,15 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing flipVertical = offscreenDrawable.isGLOriented(); final GLCapabilitiesImmutable chosenCaps = offscreenDrawable.getChosenGLCapabilities(); offscreenIsFBO = chosenCaps.isFBO(); - if( USE_GLSL_TEXTURE_RASTERIZER && offscreenIsFBO && flipVertical && gl.isGL2ES2() ) { + final boolean glslCompliant = !offscreenContext.hasRendererQuirk(GLRendererQuirks.GLSLNonCompliant); + final boolean useGLSLFlip = flipVertical && offscreenIsFBO && gl.isGL2ES2() && USE_GLSL_TEXTURE_RASTERIZER && glslCompliant; + if( DEBUG ) { + System.err.println(getThreadName()+": OffscreenBackend.initialize: useGLSLFlip "+useGLSLFlip+ + " [flip "+flipVertical+", isFBO "+offscreenIsFBO+", isGL2ES2 "+gl.isGL2ES2()+ + ", noglsl "+!USE_GLSL_TEXTURE_RASTERIZER+", glslNonCompliant "+!glslCompliant+ + ", isGL2ES2 " + gl.isGL2ES2()+"]"); + } + if( useGLSLFlip ) { final boolean _autoSwapBufferMode = helper.getAutoSwapBufferMode(); helper.setAutoSwapBufferMode(false); final GLFBODrawable fboDrawable = (GLFBODrawable) offscreenDrawable; -- cgit v1.2.3