From 98d5ae6b31802235426f0f540f7d0df74884a3d3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 2 Oct 2012 07:32:24 +0200 Subject: FBObject/GLFBODrawable: Debug / glError detection - Enh. Debug output a bit - FBObject: Detect glError @ syncFramebuffer MSAA blit, throw GLException if glError to fail-fast - TODO: May add Mesa NoFBOMSAA Quirk to disable even trying it .. --- src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java') diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java index 503b70af7..2620fb1c7 100644 --- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java @@ -84,7 +84,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { private final void initialize(boolean realize, GL gl) { if(realize) { final int maxSamples = gl.getMaxRenderbufferSamples(); - samples = samples <= maxSamples ? samples : maxSamples; + { + final int newSamples = samples <= maxSamples ? samples : maxSamples; + if(DEBUG) { + System.err.println("GLFBODrawableImpl.initialize(): samples "+samples+" -> "+newSamples+"/"+maxSamples); + } + samples = newSamples; + } final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getChosenCapabilities(); final int fbosN; @@ -189,21 +195,21 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { Throwable tGL = null; ourContext.makeCurrent(); fboBound = false; // clear bound-flag immediatly, caused by contextMadeCurrent(..) - otherwise we would swap @ release - try { + try { final int maxSamples = gl.getMaxRenderbufferSamples(); newSamples = newSamples <= maxSamples ? newSamples : maxSamples; if(0==samples && 0 "+newSamples); + System.err.println("GLFBODrawableImpl.reset(): samples [on/off] reconfig: "+samples+" -> "+newSamples+"/"+maxSamples); } initialize(false, gl); samples = newSamples; initialize(true, gl); } else { if(DEBUG) { - System.err.println("GLFBODrawableImpl.reset(): simple reconfig: "+samples+" -> "+newSamples); + System.err.println("GLFBODrawableImpl.reset(): simple reconfig: "+samples+" -> "+newSamples+"/"+maxSamples); } final int nWidth = getWidth(); final int nHeight = getHeight(); -- cgit v1.2.3