aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/impl/x11/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/x11/glx')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
index 3cf691493..697ee6353 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
@@ -392,12 +392,28 @@ public abstract class X11GLXContext extends GLContextImpl {
glXQueryExtensionsStringInitialized = false;
glXQueryExtensionsStringAvailable = false;
- if (glXExtProcAddressTable == null) {
- // FIXME: cache ProcAddressTables by OpenGL context type bits so we can
- // share them among contexts classes (GL4, GL4bc, GL3, GL3bc, ..)
- glXExtProcAddressTable = new GLXExtProcAddressTable(new GLProcAddressResolver());
- }
- resetProcAddressTable(getGLXExtProcAddressTable());
+ int key = compose8bit(major, minor, ctp, 0);
+ GLXExtProcAddressTable table = null;
+ synchronized(mappedProcAddressLock) {
+ table = (GLXExtProcAddressTable) mappedGLXProcAddress.get( key );
+ }
+ if(null != table) {
+ glXExtProcAddressTable = table;
+ if(DEBUG) {
+ System.err.println("GLContext GLX ProcAddressTable reusing key("+major+","+minor+","+ctp+") -> "+table.hashCode());
+ }
+ } else {
+ if (glXExtProcAddressTable == null) {
+ glXExtProcAddressTable = new GLXExtProcAddressTable(new GLProcAddressResolver());
+ }
+ resetProcAddressTable(getGLXExtProcAddressTable());
+ synchronized(mappedProcAddressLock) {
+ mappedGLXProcAddress.put(key, getGLXExtProcAddressTable());
+ if(DEBUG) {
+ System.err.println("GLContext GLX ProcAddressTable mapping key("+major+","+minor+","+ctp+") -> "+getGLXExtProcAddressTable().hashCode());
+ }
+ }
+ }
super.updateGLProcAddressTable(major, minor, ctp);
}