mesa: add GL 3.2 GL_CONTEXT_PROFILE_MASK query
authorBrian Paul <brianp@vmware.com>
Wed, 21 Apr 2010 02:52:56 +0000 (20:52 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 21 Apr 2010 02:52:56 +0000 (20:52 -0600)
src/mesa/main/context.c
src/mesa/main/get.c
src/mesa/main/get_gen.py
src/mesa/main/mtypes.h

index 2074b32b250d4ebf15579d87c69b3b4f0cf3fb82..1707e229c91acd01ce34e1746f1ee61c9712f3d2 100644 (file)
@@ -566,6 +566,9 @@ _mesa_init_constants(GLcontext *ctx)
    ctx->Const.MaxTransformFeedbackSeparateAttribs = MAX_FEEDBACK_ATTRIBS;
    ctx->Const.MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS;
    ctx->Const.MaxTransformFeedbackInterleavedComponents = 4 * MAX_FEEDBACK_ATTRIBS;
+
+   /* GL 3.2: hard-coded for now: */
+   ctx->Const.ProfileMask = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
 }
 
 
index e9ccbdab0bf5fa919b23966562f23f89d9500d4c..cb12737bd7aae4a4055cf5d48e33f89cb821ca72 100644 (file)
@@ -1954,6 +1954,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
       case GL_CONTEXT_FLAGS:
          params[0] = INT_TO_BOOLEAN(ctx->Const.ContextFlags);
          break;
+      case GL_CONTEXT_PROFILE_MASK:
+         params[0] = INT_TO_BOOLEAN(ctx->Const.ProfileMask);
+         break;
       default:
          goto invalid_enum_error;
    }
@@ -3853,6 +3856,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
       case GL_CONTEXT_FLAGS:
          params[0] = (GLfloat)(ctx->Const.ContextFlags);
          break;
+      case GL_CONTEXT_PROFILE_MASK:
+         params[0] = (GLfloat)(ctx->Const.ProfileMask);
+         break;
       default:
          goto invalid_enum_error;
    }
@@ -5752,6 +5758,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
       case GL_CONTEXT_FLAGS:
          params[0] = ctx->Const.ContextFlags;
          break;
+      case GL_CONTEXT_PROFILE_MASK:
+         params[0] = ctx->Const.ProfileMask;
+         break;
       default:
          goto invalid_enum_error;
    }
@@ -7652,6 +7661,9 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params )
       case GL_CONTEXT_FLAGS:
          params[0] = (GLint64)(ctx->Const.ContextFlags);
          break;
+      case GL_CONTEXT_PROFILE_MASK:
+         params[0] = (GLint64)(ctx->Const.ProfileMask);
+         break;
       default:
          goto invalid_enum_error;
    }
index e6245e4bd868dbeafb2c673d07bda0043de4346b..63b64a97a935acbb10e9ca095bac8c21bb6d03f1 100644 (file)
@@ -1139,11 +1139,16 @@ StateVars = [
          ["ctx->Const.MaxTransformFeedbackSeparateComponents"], "",
          NoState, ["EXT_transform_feedback"] ),
 
-       # GL3
+       # GL 3.0
        ( "GL_NUM_EXTENSIONS", GLint, ["_mesa_get_extension_count(ctx)"], "", NoState, NoExt ),
        ( "GL_MAJOR_VERSION", GLint, ["ctx->VersionMajor"], "", NoState, NoExt ),
        ( "GL_MINOR_VERSION", GLint, ["ctx->VersionMinor"], "", NoState, NoExt ),
-       ( "GL_CONTEXT_FLAGS", GLint, ["ctx->Const.ContextFlags"], "", NoState, NoExt )
+       ( "GL_CONTEXT_FLAGS", GLint, ["ctx->Const.ContextFlags"], "", NoState, NoExt ),
+
+       # GL 3.2
+       ( "GL_CONTEXT_PROFILE_MASK", GLint, ["ctx->Const.ProfileMask"], "",
+         NoState, NoExt )
+
 ]
 
 
index 688172a2c018e3851b06f84be24499e5e7602929..a980405f0196f4e2a68de70b7cb4ea8555a8d7be 100644 (file)
@@ -2417,13 +2417,15 @@ struct gl_constants
     */
    GLuint64 MaxServerWaitTimeout;
 
-
-   /**< GL_EXT_provoking_vertex */
+   /** GL_EXT_provoking_vertex */
    GLboolean QuadsFollowProvokingVertexConvention;
 
-   /**< OpenGL version 3.x */
+   /** OpenGL version 3.0 */
    GLbitfield ContextFlags;  /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */
 
+   /** OpenGL version 3.2 */
+   GLbitfield ProfileMask;   /**< Mask of CONTEXT_x_PROFILE_BIT */
+
    /** GL_EXT_transform_feedback */
    GLuint MaxTransformFeedbackSeparateAttribs;
    GLuint MaxTransformFeedbackSeparateComponents;