mesa: add GL 3.2 GL_CONTEXT_PROFILE_MASK query

This commit is contained in:
Brian Paul 2010-04-20 20:52:56 -06:00
parent d3e2f4fa18
commit bd1d35fb5d
4 changed files with 27 additions and 5 deletions

View 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;
}

View 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;
}

View 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 )
]

View 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;