[Mesa-dev] [PATCH v2 3/7] mesa: add support for using API_OPENGL_CORE
Brian Paul
brianp at vmware.com
Fri Jul 27 08:06:16 PDT 2012
On 07/27/2012 12:43 AM, Jordan Justen wrote:
> Signed-off-by: Jordan Justen<jordan.l.justen at intel.com>
> ---
> src/mesa/main/api_validate.c | 1 +
> src/mesa/main/context.c | 6 ++++--
> src/mesa/main/extensions.c | 4 +++-
> src/mesa/main/fbobject.c | 14 +++++++-------
> src/mesa/main/get.c | 11 +++++++----
> src/mesa/main/getstring.c | 1 +
> src/mesa/main/texformat.c | 2 +-
> src/mesa/main/teximage.c | 2 +-
> src/mesa/main/varray.c | 2 +-
> src/mesa/main/version.c | 1 +
> src/mesa/main/vtxfmt.c | 4 ++--
> 11 files changed, 29 insertions(+), 19 deletions(-)
>
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index ece0a2b..eaf614b 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -128,6 +128,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
>
> #if FEATURE_GL
> case API_OPENGL:
> + case API_OPENGL_CORE:
> {
> const struct gl_shader_program *vsProg =
> ctx->Shader.CurrentVertexProgram;
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index 41550f9..3daff96 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -431,7 +431,7 @@ one_time_init( struct gl_context *ctx )
> * when an app is linked to libGLES*, there are not enough dynamic
> * entries.
> */
> - if (ctx->API == API_OPENGL)
> + if (IS_CTX_DESKTOP_GL(ctx))
> _mesa_init_remap_table();
> }
>
> @@ -626,7 +626,7 @@ _mesa_init_constants(struct gl_context *ctx)
> #endif
>
> /* Shading language version */
> - if (ctx->API == API_OPENGL) {
> + if (IS_CTX_DESKTOP_GL(ctx)) {
> ctx->Const.GLSLVersion = 120;
> _mesa_override_glsl_version(ctx);
> }
> @@ -962,6 +962,7 @@ _mesa_initialize_context(struct gl_context *ctx,
> switch (ctx->API) {
> #if FEATURE_GL
> case API_OPENGL:
> + case API_OPENGL_CORE:
> ctx->Exec = _mesa_create_exec_table();
> break;
> #endif
> @@ -1007,6 +1008,7 @@ _mesa_initialize_context(struct gl_context *ctx,
>
> switch (ctx->API) {
> case API_OPENGL:
> + case API_OPENGL_CORE:
> #if FEATURE_dlist
> ctx->Save = _mesa_create_save_table();
> if (!ctx->Save) {
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index 0675ce7..fbc1bb7 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -41,7 +41,9 @@
>
> enum {
> DISABLE = 0,
> - GL = 1<< API_OPENGL,
> + GLL = 1<< API_OPENGL,
> + GLC = 1<< API_OPENGL_CORE,
> + GL = (1<< API_OPENGL) | (1<< API_OPENGL_CORE),
A comment on GLL such as /* GL Legacy */ would be nice.
It seems to me that quite a few of the GL extensions that are marked
as "GL" won't apply to a core profile context (ex:
GL_ARB_texture_env_combine). So there's some work there to determine
which GL extensions apply to compatiblity vs. core profile contexts.
> ES1 = 1<< API_OPENGLES,
> ES2 = 1<< API_OPENGLES2,
> };
More information about the mesa-dev
mailing list