From c8b99d197769eaec53c2def562c0ef3fc0e6a9d2 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Wed, 30 Jul 2014 02:37:47 +0200
Subject: GLContext: Don't map compatibility profiles to core profile if the
 latter are not available (restrict profile aliasing) ; GLProfile does this -
 Simplification.

GLContext shall not map compatibility profiles to core profile if the latter is are not available (restrict profile aliasing).

If a user requests a straight GL3 core profile, don't answer with a compatibility profile, e.g. GL4bc.

Hence this patch exposes the true GL profile situation more honestly the the user!

User can already query profile mappings via GLProfile, i.e.
  - GL2GL3,
  - GL4ES3, or via
  - getMaximum
  - getMaxFixedFunc
  - getMaxProgrammable
  - getMaxProgrammableCore

This also fixes an issue when a user requests 'getMaxProgrammableCore'
but would receive a GL4bc profile.
---
 src/jogl/classes/jogamp/opengl/GLContextImpl.java | 12 ------------
 1 file changed, 12 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/GLContextImpl.java')

diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index ac9e1e53c..34e247cdd 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -925,14 +925,6 @@ public abstract class GLContextImpl extends GLContext {
             hasGL4bc = createContextARBMapVersionsAvailable(4, CTX_PROFILE_COMPAT);  // GL4bc
             success |= hasGL4bc;
             if( hasGL4bc ) {
-                if( !hasGL4 ) { // last chance .. ignore hw-accel
-                    GLContext.mapAvailableGLVersion(device, 4, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
-                    hasGL4   = true;
-                }
-                if( !hasGL3 ) { // last chance .. ignore hw-accel
-                    GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
-                    hasGL3   = true;
-                }
                 if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctxOptions ) ) {
                     // Map hw-accel GL4bc to all lower compatible profiles: GL3bc, GL2
                     GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_COMPAT, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
@@ -949,10 +941,6 @@ public abstract class GLContextImpl extends GLContext {
             hasGL3bc = createContextARBMapVersionsAvailable(3, CTX_PROFILE_COMPAT);  // GL3bc
             success |= hasGL3bc;
             if( hasGL3bc ) {
-                if(!hasGL3) {  // last chance .. ignore hw-accel
-                    GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
-                    hasGL3   = true;
-                }
                 if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctxOptions ) ) {
                     // Map hw-accel GL3bc to all lower compatible profiles: GL2
                     GLContext.mapAvailableGLVersion(device, 2, CTX_PROFILE_COMPAT, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
-- 
cgit v1.2.3