From 0b316f93e9c633c44e9f7783d4748aa0d263f4fd Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 14 Feb 2012 01:25:32 +0100
Subject: Fix ExtensionAvailabilityCache ; Enhance caching.

ExtensionAvailabilityCache regression / enhancement:
  - Set context version (w/o string) before caching.
    This is required since we query the ctx version.
    Regression from 4011e70eed8c88aee0fcd051a50ab3f15bb94f68

  - Remove GLContextImpl state. Only use the passed value at initialization.

  - Defined initialization, due to the 'new' cache/instantiation logic

Remove redundant GLContext profile bits:
  - CTX_OPTION_ANY: implicit if !CTX_OPTION_FORWARD
  - CTX_IMPL_ACCEL_HARD: implicit if !CTX_IMPL_ACCEL_SOFT

Cache key (ProcAddressTable, Extensions):
  - Mask out GLContext.CTX_OPTION_DEBUG | GLContext.CTX_IMPL_ES2_COMPAT,
    since they don't influence the cached values.
---
 src/jogl/classes/javax/media/opengl/GLProfile.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/jogl/classes/javax/media/opengl/GLProfile.java')

diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 91dcd4e27..9f0093230 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -1464,7 +1464,7 @@ public class GLProfile {
                 // so we have to add the usual suspect
                 GLContext.mapAvailableGLVersion(device,
                                                 2, GLContext.CTX_PROFILE_COMPAT,
-                                                1, 5, GLContext.CTX_PROFILE_COMPAT|GLContext.CTX_OPTION_ANY);
+                                                1, 5, GLContext.CTX_PROFILE_COMPAT);
             }
             addedDesktopProfile = computeProfileMap(device, false /* desktopCtxUndef*/, false /* esCtxUndef */);
         }
@@ -1501,13 +1501,13 @@ public class GLProfile {
                 // The native ES2 impl. overwrites a previous mapping using 'ES2 compatibility' by a desktop profile 
                 GLContext.mapAvailableGLVersion(device,
                                                 2, GLContext.CTX_PROFILE_ES,
-                                                2, 0, GLContext.CTX_PROFILE_ES|GLContext.CTX_OPTION_ANY|GLContext.CTX_IMPL_ES2_COMPAT);
+                                                2, 0, GLContext.CTX_PROFILE_ES|GLContext.CTX_IMPL_ES2_COMPAT);
             }
             if( hasGLES1Impl ) {
                 // Always favor the native ES1 impl.
                 GLContext.mapAvailableGLVersion(device,
                                                 1, GLContext.CTX_PROFILE_ES,
-                                                1, 0, GLContext.CTX_PROFILE_ES|GLContext.CTX_OPTION_ANY);
+                                                1, 0, GLContext.CTX_PROFILE_ES);
             }
             addedEGLProfile = computeProfileMap(device, false /* desktopCtxUndef*/, false /* esCtxUndef */);
         } 
-- 
cgit v1.2.3