From 390ccc3e549e4cc13b7dab91387e72c1f10b77a9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 29 Aug 2015 04:20:27 +0200 Subject: Bug 1203: GLDrawable-Stateless operations in GLContextImpl, using ctxVersion and ctxOptions - State-less operation during profile probing (mapGLVersions). While probing the GLDrawable/GLProfile and GL instance may not reflect the currently probed OpenGL profile. Hence stateless operation by passing required information is required for: - GLDynamicLookupHelper must be fetched via 'major-version and contextOptions'. - GLContextImpl.resetProcAddress(..) - GLContextImpl.updateGLXProcAddressTable() - GLContextImpl.setGLFunctionAvailability(..) - ExtensionAvailabilityCache TODO: Add replacement for GLProfile validation, which is disabled right now.: drawable.getGLProfile().verifyEquality(gl.getGLProfile()) The GLDrawable.GLProfile maybe less than GL's GLProfile due to current context-version and options. Hence we would need a 'GLProfile.bwCompatibleWith(GLProfile)'. --- .../classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 14 ++++++++++++-- .../jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/macosx') diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 2f88e7619..10a11dd36 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -63,6 +63,7 @@ import com.jogamp.opengl.fixedfunc.GLMatrixFunc; import jogamp.nativewindow.macosx.OSXUtil; import jogamp.opengl.GLContextImpl; import jogamp.opengl.GLDrawableImpl; +import jogamp.opengl.GLDynamicLookupHelper; import jogamp.opengl.GLFBODrawableImpl; import jogamp.opengl.GLGraphicsConfigurationUtil; import jogamp.opengl.macosx.cgl.MacOSXCGLDrawable.GLBackendType; @@ -436,8 +437,17 @@ public class MacOSXCGLContext extends GLContextImpl return null; } + /** + * {@inheritDoc} + *

+ * Ignoring {@code contextFQN}, using {@code MacOSX}-{@link AbstractGraphicsDevice#getUniqueID()}. + *

+ */ @Override - protected final void updateGLXProcAddressTable() { + protected final void updateGLXProcAddressTable(final String contextFQN, final GLDynamicLookupHelper dlh) { + if( null == dlh ) { + throw new GLException("No GLDynamicLookupHelper for "+this); + } final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration(); final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); final String key = "MacOSX-"+adevice.getUniqueID(); @@ -455,7 +465,7 @@ public class MacOSXCGLContext extends GLContextImpl } } else { cglExtProcAddressTable = new CGLExtProcAddressTable(new GLProcAddressResolver()); - resetProcAddressTable(getCGLExtProcAddressTable()); + resetProcAddressTable(getCGLExtProcAddressTable(), dlh); synchronized(mappedContextTypeObjectLock) { mappedGLXProcAddress.put(key, getCGLExtProcAddressTable()); if(DEBUG) { diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index ab1d56e29..120de4a13 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -148,7 +148,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } @Override - public GLDynamicLookupHelper getGLDynamicLookupHelper(final String profileName) { + public final GLDynamicLookupHelper getGLDynamicLookupHelper(final int majorVersion, final int contextOptions) { return macOSXCGLDynamicLookupHelper; } -- cgit v1.2.3