From 03b15ec0efc5af944da7d65aadab3a4bdf2e6c68 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 13 Feb 2012 12:37:52 +0100 Subject: Fix JOGL GLContextImpl ProcAddressTable and Extension Caching Bug caused using wrong extension cache and probably the wrong procAddress table. - do not reuse local field value if not cached - issue resetState() after each createContextARBMapVersionsAvailable(..) query - remove cache entry for extension (copy/paste bug) - resetState() shall clean platform extProcAddressTable in specializations --- src/jogl/classes/jogamp/opengl/egl/EGLContext.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/egl') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index 1dc4a81aa..60766a57d 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -67,6 +67,7 @@ public abstract class EGLContext extends GLContextImpl { protected void resetStates() { eglQueryStringInitialized = false; eglQueryStringAvailable = false; + eglExtProcAddressTable = null; // no inner state _eglExt = null; super.resetStates(); } @@ -233,19 +234,15 @@ public abstract class EGLContext extends GLContextImpl { if(null != table) { eglExtProcAddressTable = (EGLExtProcAddressTable) table; if(DEBUG) { - System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable reusing key("+key+") -> "+table.hashCode()); + System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable reusing key("+key+") -> "+toHexString(table.hashCode())); } } else { - if (eglExtProcAddressTable == null) { - // FIXME: cache ProcAddressTables by capability bits so we can - // share them among contexts with the same capabilities - eglExtProcAddressTable = new EGLExtProcAddressTable(new GLProcAddressResolver()); - } + eglExtProcAddressTable = new EGLExtProcAddressTable(new GLProcAddressResolver()); resetProcAddressTable(getEGLExtProcAddressTable()); synchronized(mappedContextTypeObjectLock) { mappedGLXProcAddress.put(key, getEGLExtProcAddressTable()); if(DEBUG) { - System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable mapping key("+key+") -> "+getEGLExtProcAddressTable().hashCode()); + System.err.println(getThreadName() + ": !!! GLContext EGL ProcAddressTable mapping key("+key+") -> "+toHexString(getEGLExtProcAddressTable().hashCode())); } } } -- cgit v1.2.3