From: Paul Berry Date: Tue, 27 Nov 2012 20:26:51 +0000 (-0800) Subject: mesa: Rename API_OPENGL to API_OPENGL_COMPAT. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dbd6135bc1ba285128ab991c03c4df6fbd6fefe8;p=mesa.git mesa: Rename API_OPENGL to API_OPENGL_COMPAT. This should help avoid confusion now that we're using the gl_api enum to distinguishing between core and compatibility API's. The corresponding enum value for core API's is API_OPENGL_CORE. Acked-by: Eric Anholt Acked-by: Matt Turner Acked-by: Kenneth Graunke --- diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c index e77c43f140c..00b9b0aebe2 100644 --- a/src/gallium/state_trackers/dri/common/dri_context.c +++ b/src/gallium/state_trackers/dri/common/dri_context.c @@ -81,10 +81,10 @@ dri_create_context(gl_api api, const struct gl_config * visual, case API_OPENGLES2: attribs.profile = ST_PROFILE_OPENGL_ES2; break; - case API_OPENGL: + case API_OPENGL_COMPAT: case API_OPENGL_CORE: - attribs.profile = api == API_OPENGL ? ST_PROFILE_DEFAULT - : ST_PROFILE_OPENGL_CORE; + attribs.profile = api == API_OPENGL_COMPAT ? ST_PROFILE_DEFAULT + : ST_PROFILE_OPENGL_CORE; attribs.major = major_version; attribs.minor = minor_version; diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py index 7eccb7dca91..0b7f6a04403 100755 --- a/src/glsl/builtins/tools/generate_builtins.py +++ b/src/glsl/builtins/tools/generate_builtins.py @@ -173,7 +173,7 @@ gl_shader * read_builtins(GLenum target, const char *protos, const char **functions, unsigned count) { struct gl_context fakeCtx; - fakeCtx.API = API_OPENGL; + fakeCtx.API = API_OPENGL_COMPAT; fakeCtx.Const.GLSLVersion = 140; fakeCtx.Extensions.ARB_ES2_compatibility = true; fakeCtx.Const.ForceGLSLExtensionsWarn = false; diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c index 35db4708781..7c2ded850bd 100644 --- a/src/glsl/glcpp/glcpp.c +++ b/src/glsl/glcpp/glcpp.c @@ -111,7 +111,7 @@ main (int argc, char *argv[]) if (shader == NULL) return 1; - ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL); + ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL_COMPAT); printf("%s", shader); fprintf(stderr, "%s", info_log); diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index 04143ad4373..33cd79c8544 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -223,7 +223,7 @@ main(int argc, char **argv) if (argc <= optind) usage_fail(argv[0]); - initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL); + initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL_COMPAT); struct gl_shader_program *whole_program; diff --git a/src/glsl/test_optpass.cpp b/src/glsl/test_optpass.cpp index 5ed11702c87..ce5df24d904 100644 --- a/src/glsl/test_optpass.cpp +++ b/src/glsl/test_optpass.cpp @@ -197,7 +197,7 @@ int test_optpass(int argc, char **argv) struct gl_context local_ctx; struct gl_context *ctx = &local_ctx; - initialize_context_to_defaults(ctx, API_OPENGL); + initialize_context_to_defaults(ctx, API_OPENGL_COMPAT); ctx->Driver.NewShader = _mesa_new_shader; diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py index 9b716894caf..593d1955b1c 100644 --- a/src/mapi/glapi/gen/gl_genexec.py +++ b/src/mapi/glapi/gen/gl_genexec.py @@ -166,7 +166,7 @@ class PrintCode(gl_XML.gl_print_base): condition_parts = [] if f.desktop: if f.deprecated: - condition_parts.append('ctx->API == API_OPENGL') + condition_parts.append('ctx->API == API_OPENGL_COMPAT') else: condition_parts.append('_mesa_is_desktop_gl(ctx)') if 'es1' in f.api_map: diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 7d58281c181..e4ff5c9004f 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -567,7 +567,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) save->PolygonCull = ctx->Polygon.CullFlag; _mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL); _mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL, GL_FALSE); - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { _mesa_set_enable(ctx, GL_POLYGON_SMOOTH, GL_FALSE); _mesa_set_enable(ctx, GL_POLYGON_STIPPLE, GL_FALSE); } @@ -580,14 +580,14 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) } if (state & MESA_META_SHADER) { - if (ctx->API == API_OPENGL && ctx->Extensions.ARB_vertex_program) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_vertex_program) { save->VertexProgramEnabled = ctx->VertexProgram.Enabled; _mesa_reference_vertprog(ctx, &save->VertexProgram, ctx->VertexProgram.Current); _mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, GL_FALSE); } - if (ctx->API == API_OPENGL && ctx->Extensions.ARB_fragment_program) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_fragment_program) { save->FragmentProgramEnabled = ctx->FragmentProgram.Enabled; _mesa_reference_fragprog(ctx, &save->FragmentProgram, ctx->FragmentProgram.Current); @@ -623,7 +623,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) save->EnvMode = ctx->Texture.Unit[0].EnvMode; /* Disable all texture units */ - if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) { + if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) { for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { save->TexEnabled[u] = ctx->Texture.Unit[u].Enabled; save->TexGenEnabled[u] = ctx->Texture.Unit[u].TexGenEnabled; @@ -636,7 +636,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) if (ctx->Extensions.OES_EGL_image_external) _mesa_set_enable(ctx, GL_TEXTURE_EXTERNAL_OES, GL_FALSE); - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE); _mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE); if (ctx->Extensions.NV_texture_rectangle) @@ -661,7 +661,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) /* set defaults for unit[0] */ _mesa_ActiveTexture(GL_TEXTURE0); _mesa_ClientActiveTexture(GL_TEXTURE0); - if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) { + if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) { _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); } } @@ -885,7 +885,7 @@ _mesa_meta_end(struct gl_context *ctx) _mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode); _mesa_PolygonMode(GL_BACK, save->BackPolygonMode); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { _mesa_set_enable(ctx, GL_POLYGON_STIPPLE, save->PolygonStipple); _mesa_set_enable(ctx, GL_POLYGON_SMOOTH, save->PolygonSmooth); } @@ -900,7 +900,7 @@ _mesa_meta_end(struct gl_context *ctx) } if (state & MESA_META_SHADER) { - if (ctx->API == API_OPENGL && ctx->Extensions.ARB_vertex_program) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_vertex_program) { _mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, save->VertexProgramEnabled); _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, @@ -908,7 +908,7 @@ _mesa_meta_end(struct gl_context *ctx) _mesa_reference_vertprog(ctx, &save->VertexProgram, NULL); } - if (ctx->API == API_OPENGL && ctx->Extensions.ARB_fragment_program) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_fragment_program) { _mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, save->FragmentProgramEnabled); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, @@ -941,7 +941,7 @@ _mesa_meta_end(struct gl_context *ctx) _mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled); _mesa_ClearStencil(stencil->Clear); - if (ctx->API == API_OPENGL && ctx->Extensions.EXT_stencil_two_side) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_stencil_two_side) { _mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT, stencil->TestTwoSide); _mesa_ActiveStencilFaceEXT(stencil->ActiveFace @@ -973,7 +973,7 @@ _mesa_meta_end(struct gl_context *ctx) ASSERT(ctx->Texture.CurrentUnit == 0); /* restore texenv for unit[0] */ - if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) { + if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) { _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, save->EnvMode); } @@ -988,7 +988,7 @@ _mesa_meta_end(struct gl_context *ctx) } /* Restore fixed function texture enables, texgen */ - if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) { + if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) { for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { if (ctx->Texture.Unit[u].Enabled != save->TexEnabled[u]) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -3268,7 +3268,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, mipmap->FBO); - if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) + if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); else assert(!genMipmapSave); diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 917b9465b74..9cebcea924c 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -183,7 +183,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, switch (api) { case __DRI_API_OPENGL: - mesa_api = API_OPENGL; + mesa_api = API_OPENGL_COMPAT; break; case __DRI_API_GLES: mesa_api = API_OPENGLES; @@ -221,13 +221,13 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, } /* Mesa does not support the GL_ARB_compatibilty extension or the - * compatibility profile. This means that we treat a API_OPENGL 3.1 as - * API_OPENGL_CORE and reject API_OPENGL 3.2+. + * compatibility profile. This means that we treat a API_OPENGL_COMPAT 3.1 as + * API_OPENGL_CORE and reject API_OPENGL_COMPAT 3.2+. */ - if (mesa_api == API_OPENGL && major_version == 3 && minor_version == 1) + if (mesa_api == API_OPENGL_COMPAT && major_version == 3 && minor_version == 1) mesa_api = API_OPENGL_CORE; - if (mesa_api == API_OPENGL + if (mesa_api == API_OPENGL_COMPAT && ((major_version > 3) || (major_version == 3 && minor_version >= 2))) { *error = __DRI_CTX_ERROR_BAD_API; @@ -244,7 +244,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, * anything specific about this case. However, none of the known flags * have any meaning in an ES context, so this seems safe. */ - if (mesa_api != API_OPENGL + if (mesa_api != API_OPENGL_COMPAT && mesa_api != API_OPENGL_CORE && flags != 0) { *error = __DRI_CTX_ERROR_BAD_FLAG; diff --git a/src/mesa/drivers/dri/common/drisw_util.c b/src/mesa/drivers/dri/common/drisw_util.c index d6927485425..8fdb05ec336 100644 --- a/src/mesa/drivers/dri/common/drisw_util.c +++ b/src/mesa/drivers/dri/common/drisw_util.c @@ -117,7 +117,7 @@ driCreateContextAttribs(__DRIscreen *screen, int api, switch (api) { case __DRI_API_OPENGL: - mesa_api = API_OPENGL; + mesa_api = API_OPENGL_COMPAT; break; case __DRI_API_GLES: mesa_api = API_OPENGLES; diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index c0d1f93bece..d47e20f8608 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -175,7 +175,7 @@ i915CreateContext(int api, * and version. */ switch (api) { - case API_OPENGL: { + case API_OPENGL_COMPAT: { const unsigned max_version = (ctx->Extensions.ARB_fragment_shader && ctx->Extensions.ARB_occlusion_query) ? 20 : 15; diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index f439cf20abc..4b1b247ce7d 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -101,7 +101,7 @@ brwCreateContext(int api, /* Determine max_supported_version. */ switch (api) { - case API_OPENGL: + case API_OPENGL_COMPAT: max_supported_version = supports_gl30 ? 30 : 21; break; case API_OPENGLES: diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 4e2742fe697..da231270bc1 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -797,7 +797,7 @@ intelCreateContext(gl_api api, sharedContextPrivate); } else { switch (api) { - case API_OPENGL: + case API_OPENGL_COMPAT: if (major_version > 1 || minor_version > 3) { *error = __DRI_CTX_ERROR_BAD_VERSION; success = false; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 80e93950b2f..7e7dcc49944 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -60,7 +60,7 @@ nouveau_context_create(gl_api api, struct gl_context *ctx; switch (api) { - case API_OPENGL: + case API_OPENGL_COMPAT: /* Do after-the-fact version checking (below). */ break; @@ -133,7 +133,7 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen, nouveau_fbo_functions_init(&functions); /* Initialize the mesa context. */ - _mesa_initialize_context(ctx, API_OPENGL, visual, + _mesa_initialize_context(ctx, API_OPENGL_COMPAT, visual, share_ctx, &functions); nouveau_state_init(ctx); diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 677dc8d20d3..360ba72c13d 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -213,7 +213,7 @@ GLboolean r200CreateContext( gl_api api, int tcl_mode; switch (api) { - case API_OPENGL: + case API_OPENGL_COMPAT: if (major_version > 1 || minor_version > 3) { *error = __DRI_CTX_ERROR_BAD_VERSION; return GL_FALSE; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 566a3728d08..6dec1379afc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -147,7 +147,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon, else shareCtx = NULL; - if (!_mesa_initialize_context(&radeon->glCtx, API_OPENGL, + if (!_mesa_initialize_context(&radeon->glCtx, API_OPENGL_COMPAT, glVisual, shareCtx, functions)) return GL_FALSE; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 962f08ac698..1e0da0bcf6d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -179,7 +179,7 @@ r100CreateContext( gl_api api, int tcl_mode, fthrottle_mode; switch (api) { - case API_OPENGL: + case API_OPENGL_COMPAT: if (major_version > 1 || minor_version > 3) { *error = __DRI_CTX_ERROR_BAD_VERSION; return GL_FALSE; diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 45ef3c24638..3a47cdb5808 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -706,7 +706,7 @@ dri_create_context(gl_api api, (void) flags; switch (api) { - case API_OPENGL: + case API_OPENGL_COMPAT: if (major_version > 2 || (major_version == 2 && minor_version > 1)) { *error = __DRI_CTX_ERROR_BAD_VERSION; @@ -768,7 +768,7 @@ dri_create_context(gl_api api, switch (api) { case API_OPENGL_CORE: /* XXX fix me, fall-through for now */ - case API_OPENGL: + case API_OPENGL_COMPAT: _mesa_enable_1_3_extensions(mesaCtx); _mesa_enable_1_4_extensions(mesaCtx); _mesa_enable_1_5_extensions(mesaCtx); diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 1b12d8c2d09..e02b2f3ca59 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -709,7 +709,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, functions.GetBufferSize = NULL; if (!_mesa_initialize_context(&osmesa->mesa, - API_OPENGL, + API_OPENGL_COMPAT, osmesa->gl_visual, sharelist ? &sharelist->mesa : (struct gl_context *) NULL, diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 5728d3aa4f2..9f6f750d027 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -610,7 +610,7 @@ WMesaContext WMesaCreateContext(HDC hDC, /* initialize the Mesa context data */ ctx = &c->gl_ctx; - _mesa_initialize_context(ctx, API_OPENGL, visual, + _mesa_initialize_context(ctx, API_OPENGL_COMPAT, visual, NULL, &functions); /* visual no longer needed - it was copied by _mesa_initialize_context() */ diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 43a97f9eb5d..a466943a860 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -900,7 +900,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) /* initialize with default driver functions, then plug in XMesa funcs */ _mesa_init_driver_functions(&functions); xmesa_init_driver_functions(v, &functions); - if (!_mesa_initialize_context(mesaCtx, API_OPENGL, &v->mesa_visual, + if (!_mesa_initialize_context(mesaCtx, API_OPENGL_COMPAT, &v->mesa_visual, share_list ? &(share_list->mesa) : (struct gl_context *) NULL, &functions)) { free(c); diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 6b66319a9e4..59d399b4231 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -1507,7 +1507,7 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx, SET_Color4ub(dest, _mesa_Color4ub); SET_Materialf(dest, _mesa_Materialf); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { SET_Color3b(dest, _mesa_Color3b); SET_Color3d(dest, _mesa_Color3d); SET_Color3i(dest, _mesa_Color3i); @@ -1654,7 +1654,7 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx, SET_FogCoorddv(dest, _mesa_FogCoorddv); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { SET_VertexAttrib1sNV(dest, _mesa_VertexAttrib1sNV); SET_VertexAttrib1dNV(dest, _mesa_VertexAttrib1dNV); SET_VertexAttrib2sNV(dest, _mesa_VertexAttrib2sNV); diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 6f025080038..e47db23e03c 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -124,7 +124,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function) return GL_FALSE; break; - case API_OPENGL: + case API_OPENGL_COMPAT: case API_OPENGL_CORE: { const struct gl_shader_program *vsProg = @@ -219,7 +219,7 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name) case GL_QUADS: case GL_QUAD_STRIP: case GL_POLYGON: - valid_enum = (ctx->API == API_OPENGL); + valid_enum = (ctx->API == API_OPENGL_COMPAT); break; case GL_LINES_ADJACENCY: case GL_LINE_STRIP_ADJACENCY: diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index acb33885ab0..a19d610545d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1150,7 +1150,7 @@ _mesa_PopAttrib(void) _mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV, ctx->Point.SpriteRMode); - if ((ctx->API == API_OPENGL && ctx->Version >= 20) + if ((ctx->API == API_OPENGL_COMPAT && ctx->Version >= 20) || ctx->API == API_OPENGL_CORE) _mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN, (GLfloat)ctx->Point.SpriteOrigin); diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index fd430aad0cc..76f0d4671a6 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -353,7 +353,7 @@ updated_drawbuffers(struct gl_context *ctx) { FLUSH_VERTICES(ctx, _NEW_BUFFERS); - if (ctx->API == API_OPENGL && !ctx->Extensions.ARB_ES2_compatibility) { + if (ctx->API == API_OPENGL_COMPAT && !ctx->Extensions.ARB_ES2_compatibility) { struct gl_framebuffer *fb = ctx->DrawBuffer; /* Flag the FBO as requiring validation. */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 0508378b7be..fa552e8180b 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -963,7 +963,7 @@ _mesa_initialize_context(struct gl_context *ctx, sizeof(ctx->TextureFormatSupported)); switch (ctx->API) { - case API_OPENGL: + case API_OPENGL_COMPAT: ctx->Save = _mesa_create_save_table(ctx); if (!ctx->Save) { _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index a5f770a6e9d..063f2a381ec 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -296,7 +296,7 @@ do { \ static inline GLboolean _mesa_is_desktop_gl(const struct gl_context *ctx) { - return ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE; + return ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGL_CORE; } diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index c7114b73a67..b48794f950b 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -278,7 +278,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) switch (cap) { case GL_ALPHA_TEST: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Color.AlphaEnabled == state) return; @@ -286,7 +286,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Color.AlphaEnabled = state; break; case GL_AUTO_NORMAL: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.AutoNormal == state) return; @@ -333,7 +333,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } break; case GL_COLOR_MATERIAL: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Light.ColorMaterialEnabled == state) return; @@ -369,7 +369,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Color.DitherFlag = state; break; case GL_FOG: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Fog.Enabled == state) return; @@ -384,7 +384,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_LIGHT5: case GL_LIGHT6: case GL_LIGHT7: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state) return; @@ -399,7 +399,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } break; case GL_LIGHTING: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Light.Enabled == state) return; @@ -420,7 +420,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->_TriangleCaps ^= DD_LINE_SMOOTH; break; case GL_LINE_STIPPLE: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Line.StippleFlag == state) return; @@ -429,7 +429,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->_TriangleCaps ^= DD_LINE_STIPPLE; break; case GL_INDEX_LOGIC_OP: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Color.IndexLogicOpEnabled == state) return; @@ -445,7 +445,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Color.ColorLogicOpEnabled = state; break; case GL_MAP1_COLOR_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1Color4 == state) return; @@ -453,7 +453,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1Color4 = state; break; case GL_MAP1_INDEX: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1Index == state) return; @@ -461,7 +461,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1Index = state; break; case GL_MAP1_NORMAL: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1Normal == state) return; @@ -469,7 +469,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1Normal = state; break; case GL_MAP1_TEXTURE_COORD_1: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord1 == state) return; @@ -477,7 +477,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1TextureCoord1 = state; break; case GL_MAP1_TEXTURE_COORD_2: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord2 == state) return; @@ -485,7 +485,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1TextureCoord2 = state; break; case GL_MAP1_TEXTURE_COORD_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord3 == state) return; @@ -493,7 +493,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1TextureCoord3 = state; break; case GL_MAP1_TEXTURE_COORD_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1TextureCoord4 == state) return; @@ -501,7 +501,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1TextureCoord4 = state; break; case GL_MAP1_VERTEX_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1Vertex3 == state) return; @@ -509,7 +509,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1Vertex3 = state; break; case GL_MAP1_VERTEX_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map1Vertex4 == state) return; @@ -517,7 +517,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map1Vertex4 = state; break; case GL_MAP2_COLOR_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2Color4 == state) return; @@ -525,7 +525,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2Color4 = state; break; case GL_MAP2_INDEX: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2Index == state) return; @@ -533,7 +533,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2Index = state; break; case GL_MAP2_NORMAL: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2Normal == state) return; @@ -541,7 +541,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2Normal = state; break; case GL_MAP2_TEXTURE_COORD_1: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord1 == state) return; @@ -549,7 +549,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2TextureCoord1 = state; break; case GL_MAP2_TEXTURE_COORD_2: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord2 == state) return; @@ -557,7 +557,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2TextureCoord2 = state; break; case GL_MAP2_TEXTURE_COORD_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord3 == state) return; @@ -565,7 +565,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2TextureCoord3 = state; break; case GL_MAP2_TEXTURE_COORD_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2TextureCoord4 == state) return; @@ -573,7 +573,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2TextureCoord4 = state; break; case GL_MAP2_VERTEX_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2Vertex3 == state) return; @@ -581,7 +581,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2Vertex3 = state; break; case GL_MAP2_VERTEX_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Eval.Map2Vertex4 == state) return; @@ -589,7 +589,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Eval.Map2Vertex4 = state; break; case GL_NORMALIZE: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Transform.Normalize == state) return; @@ -597,7 +597,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Transform.Normalize = state; break; case GL_POINT_SMOOTH: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Point.SmoothFlag == state) return; @@ -615,7 +615,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->_TriangleCaps ^= DD_TRI_SMOOTH; break; case GL_POLYGON_STIPPLE: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Polygon.StippleFlag == state) return; @@ -646,7 +646,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Polygon.OffsetFill = state; break; case GL_RESCALE_NORMAL_EXT: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (ctx->Transform.RescaleNormals == state) return; @@ -666,21 +666,21 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Stencil.Enabled = state; break; case GL_TEXTURE_1D: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) { return; } break; case GL_TEXTURE_2D: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) { return; } break; case GL_TEXTURE_3D: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) { return; @@ -693,7 +693,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) { struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (texUnit) { @@ -745,7 +745,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_ARB_texture_cube_map */ case GL_TEXTURE_CUBE_MAP_ARB: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; CHECK_EXTENSION(ARB_texture_cube_map, cap); if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) { @@ -755,7 +755,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_EXT_secondary_color */ case GL_COLOR_SUM_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap); if (ctx->Fog.ColorSumEnabled == state) @@ -801,7 +801,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_IBM_rasterpos_clip */ case GL_RASTER_POSITION_UNCLIPPED_IBM: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (ctx->Transform.RasterPositionUnclipped == state) return; @@ -811,7 +811,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_NV_point_sprite */ case GL_POINT_SPRITE_NV: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite, cap); if (ctx->Point.PointSprite == state) @@ -821,7 +821,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) break; case GL_VERTEX_PROGRAM_ARB: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(ARB_vertex_program, cap); if (ctx->VertexProgram.Enabled == state) @@ -842,7 +842,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->VertexProgram.PointSizeEnabled = state; break; case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(ARB_vertex_program, cap); if (ctx->VertexProgram.TwoSideEnabled == state) @@ -853,7 +853,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_NV_texture_rectangle */ case GL_TEXTURE_RECTANGLE_NV: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(NV_texture_rectangle, cap); if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) { @@ -863,7 +863,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_EXT_stencil_two_side */ case GL_STENCIL_TEST_TWO_SIDE_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(EXT_stencil_two_side, cap); if (ctx->Stencil.TestTwoSide == state) @@ -878,7 +878,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) break; case GL_FRAGMENT_PROGRAM_ARB: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(ARB_fragment_program, cap); if (ctx->FragmentProgram.Enabled == state) @@ -909,7 +909,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) break; case GL_FRAGMENT_SHADER_ATI: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(ATI_fragment_shader, cap); if (ctx->ATIFragmentShader.Enabled == state) @@ -920,7 +920,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_MESA_texture_array */ case GL_TEXTURE_1D_ARRAY_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(MESA_texture_array, cap); if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) { @@ -929,7 +929,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) break; case GL_TEXTURE_2D_ARRAY_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(MESA_texture_array, cap); if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) { @@ -1154,11 +1154,11 @@ _mesa_IsEnabled( GLenum cap ) switch (cap) { case GL_ALPHA_TEST: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Color.AlphaEnabled; case GL_AUTO_NORMAL: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.AutoNormal; case GL_BLEND: @@ -1179,7 +1179,7 @@ _mesa_IsEnabled( GLenum cap ) return (ctx->Transform.ClipPlanesEnabled >> p) & 1; } case GL_COLOR_MATERIAL: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Light.ColorMaterialEnabled; case GL_CULL_FACE: @@ -1193,11 +1193,11 @@ _mesa_IsEnabled( GLenum cap ) case GL_DITHER: return ctx->Color.DitherFlag; case GL_FOG: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Fog.Enabled; case GL_LIGHTING: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Light.Enabled; case GL_LIGHT0: @@ -1208,7 +1208,7 @@ _mesa_IsEnabled( GLenum cap ) case GL_LIGHT5: case GL_LIGHT6: case GL_LIGHT7: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Light.Light[cap-GL_LIGHT0].Enabled; case GL_LINE_SMOOTH: @@ -1216,11 +1216,11 @@ _mesa_IsEnabled( GLenum cap ) goto invalid_enum_error; return ctx->Line.SmoothFlag; case GL_LINE_STIPPLE: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Line.StippleFlag; case GL_INDEX_LOGIC_OP: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Color.IndexLogicOpEnabled; case GL_COLOR_LOGIC_OP: @@ -1228,83 +1228,83 @@ _mesa_IsEnabled( GLenum cap ) goto invalid_enum_error; return ctx->Color.ColorLogicOpEnabled; case GL_MAP1_COLOR_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1Color4; case GL_MAP1_INDEX: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1Index; case GL_MAP1_NORMAL: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1Normal; case GL_MAP1_TEXTURE_COORD_1: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1TextureCoord1; case GL_MAP1_TEXTURE_COORD_2: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1TextureCoord2; case GL_MAP1_TEXTURE_COORD_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1TextureCoord3; case GL_MAP1_TEXTURE_COORD_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1TextureCoord4; case GL_MAP1_VERTEX_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1Vertex3; case GL_MAP1_VERTEX_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map1Vertex4; case GL_MAP2_COLOR_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2Color4; case GL_MAP2_INDEX: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2Index; case GL_MAP2_NORMAL: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2Normal; case GL_MAP2_TEXTURE_COORD_1: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2TextureCoord1; case GL_MAP2_TEXTURE_COORD_2: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2TextureCoord2; case GL_MAP2_TEXTURE_COORD_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2TextureCoord3; case GL_MAP2_TEXTURE_COORD_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2TextureCoord4; case GL_MAP2_VERTEX_3: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2Vertex3; case GL_MAP2_VERTEX_4: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Eval.Map2Vertex4; case GL_NORMALIZE: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Transform.Normalize; case GL_POINT_SMOOTH: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Point.SmoothFlag; case GL_POLYGON_SMOOTH: @@ -1312,7 +1312,7 @@ _mesa_IsEnabled( GLenum cap ) goto invalid_enum_error; return ctx->Polygon.SmoothFlag; case GL_POLYGON_STIPPLE: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Polygon.StippleFlag; case GL_POLYGON_OFFSET_POINT: @@ -1326,7 +1326,7 @@ _mesa_IsEnabled( GLenum cap ) case GL_POLYGON_OFFSET_FILL: return ctx->Polygon.OffsetFill; case GL_RESCALE_NORMAL_EXT: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return ctx->Transform.RescaleNormals; case GL_SCISSOR_TEST: @@ -1334,15 +1334,15 @@ _mesa_IsEnabled( GLenum cap ) case GL_STENCIL_TEST: return ctx->Stencil.Enabled; case GL_TEXTURE_1D: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return is_texture_enabled(ctx, TEXTURE_1D_BIT); case GL_TEXTURE_2D: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return is_texture_enabled(ctx, TEXTURE_2D_BIT); case GL_TEXTURE_3D: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return is_texture_enabled(ctx, TEXTURE_3D_BIT); case GL_TEXTURE_GEN_S: @@ -1352,7 +1352,7 @@ _mesa_IsEnabled( GLenum cap ) { const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; if (texUnit) { @@ -1376,37 +1376,37 @@ _mesa_IsEnabled( GLenum cap ) /* client-side state */ case GL_VERTEX_ARRAY: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled != 0); case GL_NORMAL_ARRAY: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled != 0); case GL_COLOR_ARRAY: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled != 0); case GL_INDEX_ARRAY: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled != 0); case GL_TEXTURE_COORD_ARRAY: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)] .Enabled != 0); case GL_EDGE_FLAG_ARRAY: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled != 0); case GL_FOG_COORDINATE_ARRAY_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(EXT_fog_coord); return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0); case GL_SECONDARY_COLOR_ARRAY_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(EXT_secondary_color); return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0); @@ -1422,7 +1422,7 @@ _mesa_IsEnabled( GLenum cap ) /* GL_EXT_secondary_color */ case GL_COLOR_SUM_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program); return ctx->Fog.ColorSumEnabled; @@ -1447,19 +1447,19 @@ _mesa_IsEnabled( GLenum cap ) /* GL_IBM_rasterpos_clip */ case GL_RASTER_POSITION_UNCLIPPED_IBM: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->Transform.RasterPositionUnclipped; /* GL_NV_point_sprite */ case GL_POINT_SPRITE_NV: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_enum_error; CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite) return ctx->Point.PointSprite; case GL_VERTEX_PROGRAM_ARB: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(ARB_vertex_program); return ctx->VertexProgram.Enabled; @@ -1472,27 +1472,27 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION(ARB_vertex_program); return ctx->VertexProgram.PointSizeEnabled; case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(ARB_vertex_program); return ctx->VertexProgram.TwoSideEnabled; /* GL_NV_texture_rectangle */ case GL_TEXTURE_RECTANGLE_NV: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(NV_texture_rectangle); return is_texture_enabled(ctx, TEXTURE_RECT_BIT); /* GL_EXT_stencil_two_side */ case GL_STENCIL_TEST_TWO_SIDE_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(EXT_stencil_two_side); return ctx->Stencil.TestTwoSide; case GL_FRAGMENT_PROGRAM_ARB: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; return ctx->FragmentProgram.Enabled; @@ -1511,7 +1511,7 @@ _mesa_IsEnabled( GLenum cap ) return ctx->Transform.DepthClamp; case GL_FRAGMENT_SHADER_ATI: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum_error; CHECK_EXTENSION(ATI_fragment_shader); return ctx->ATIFragmentShader.Enabled; @@ -1530,7 +1530,7 @@ _mesa_IsEnabled( GLenum cap ) /* GL_NV_primitive_restart */ case GL_PRIMITIVE_RESTART_NV: - if (ctx->API != API_OPENGL || !ctx->Extensions.NV_primitive_restart) { + if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_primitive_restart) { goto invalid_enum_error; } return ctx->Array.PrimitiveRestart; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index d5a7886c9c8..9e23a66d71e 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -41,9 +41,9 @@ enum { DISABLE = 0, - GLL = 1 << API_OPENGL, /* GL Legacy / Compatibility */ + GLL = 1 << API_OPENGL_COMPAT, /* GL Legacy / Compatibility */ GLC = 1 << API_OPENGL_CORE, /* GL Core */ - GL = (1 << API_OPENGL) | (1 << API_OPENGL_CORE), + GL = (1 << API_OPENGL_COMPAT) | (1 << API_OPENGL_CORE), ES1 = 1 << API_OPENGLES, ES2 = 1 << API_OPENGLES2, }; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 22b518e8694..2e2fc2ca314 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1072,14 +1072,14 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: - return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0; case GL_LUMINANCE: case GL_LUMINANCE4: case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: - return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0; case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: @@ -1088,14 +1088,14 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0; case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: - return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0; case GL_RGB8: return GL_RGB; @@ -1146,11 +1146,11 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) ? GL_DEPTH_STENCIL_EXT : 0; case GL_DEPTH_COMPONENT32F: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_buffer_float) + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float) ? GL_DEPTH_COMPONENT : 0; case GL_DEPTH32F_STENCIL8: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_buffer_float) + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float) ? GL_DEPTH_STENCIL : 0; case GL_RED: case GL_R16: @@ -1169,7 +1169,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) /* signed normalized texture formats */ case GL_R8_SNORM: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm) + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) ? GL_RED : 0; case GL_RED_SNORM: case GL_R16_SNORM: @@ -1177,7 +1177,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) ? GL_RED : 0; case GL_RG8_SNORM: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm) + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) ? GL_RG : 0; case GL_RG_SNORM: case GL_RG16_SNORM: @@ -1185,7 +1185,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) ? GL_RG : 0; case GL_RGB8_SNORM: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm) + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) ? GL_RGB : 0; case GL_RGB_SNORM: case GL_RGB16_SNORM: @@ -1193,7 +1193,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) ? GL_RGB : 0; case GL_RGBA8_SNORM: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm) + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm) ? GL_RGBA : 0; case GL_RGBA_SNORM: case GL_RGBA16_SNORM: @@ -1202,37 +1202,37 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_ALPHA_SNORM: case GL_ALPHA8_SNORM: case GL_ALPHA16_SNORM: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm && ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0; case GL_LUMINANCE_SNORM: case GL_LUMINANCE8_SNORM: case GL_LUMINANCE16_SNORM: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0; case GL_LUMINANCE_ALPHA_SNORM: case GL_LUMINANCE8_ALPHA8_SNORM: case GL_LUMINANCE16_ALPHA16_SNORM: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0; case GL_INTENSITY_SNORM: case GL_INTENSITY8_SNORM: case GL_INTENSITY16_SNORM: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm && ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0; case GL_R16F: case GL_R32F: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_texture_rg && ctx->Extensions.ARB_texture_float) ? GL_RED : 0; case GL_RG16F: case GL_RG32F: return ctx->Version >= 30 - || (ctx->API == API_OPENGL && + || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_texture_rg && ctx->Extensions.ARB_texture_float) ? GL_RG : 0; case GL_RGB16F: @@ -1247,22 +1247,22 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) ? GL_RGBA : 0; case GL_ALPHA16F_ARB: case GL_ALPHA32F_ARB: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_texture_float && ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0; case GL_LUMINANCE16F_ARB: case GL_LUMINANCE32F_ARB: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_texture_float && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0; case GL_LUMINANCE_ALPHA16F_ARB: case GL_LUMINANCE_ALPHA32F_ARB: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_texture_float && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0; case GL_INTENSITY16F_ARB: case GL_INTENSITY32F_ARB: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_texture_float && ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0; case GL_RGB9_E5: @@ -1321,7 +1321,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_INTENSITY16UI_EXT: case GL_INTENSITY32I_EXT: case GL_INTENSITY32UI_EXT: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_integer && ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0; @@ -1331,7 +1331,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_LUMINANCE16UI_EXT: case GL_LUMINANCE32I_EXT: case GL_LUMINANCE32UI_EXT: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_integer && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0; @@ -1341,7 +1341,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_LUMINANCE_ALPHA16UI_EXT: case GL_LUMINANCE_ALPHA32I_EXT: case GL_LUMINANCE_ALPHA32UI_EXT: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_integer && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0; @@ -1351,7 +1351,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_ALPHA16UI_EXT: case GL_ALPHA32I_EXT: case GL_ALPHA32UI_EXT: - return ctx->API == API_OPENGL && + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_integer && ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0; @@ -2498,7 +2498,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, } return; case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: - if ((ctx->API != API_OPENGL || !ctx->Extensions.ARB_framebuffer_object) + if ((ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_framebuffer_object) && ctx->API != API_OPENGL_CORE && !_mesa_is_gles3(ctx)) { goto invalid_pname_enum; @@ -3042,7 +3042,7 @@ invalidate_framebuffer_storage(GLenum target, GLsizei numAttachments, /* Accumulation buffers and auxilary buffers were removed in * OpenGL 3.1, and they never existed in OpenGL ES. */ - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_enum; break; case GL_COLOR: diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 07405fb4b42..b37e95f086b 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -141,7 +141,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params ) update_fog_scale(ctx); break; case GL_FOG_INDEX: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; if (ctx->Fog.Index == *params) return; @@ -163,7 +163,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params ) break; case GL_FOG_COORDINATE_SOURCE_EXT: { GLenum p = (GLenum) (GLint) *params; - if (ctx->API != API_OPENGL || !ctx->Extensions.EXT_fog_coord || + if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.EXT_fog_coord || (p != GL_FOG_COORDINATE_EXT && p != GL_FRAGMENT_DEPTH_EXT)) { _mesa_error(ctx, GL_INVALID_ENUM, "glFog"); return; @@ -176,7 +176,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params ) } case GL_FOG_DISTANCE_MODE_NV: { GLenum p = (GLenum) (GLint) *params; - if (ctx->API != API_OPENGL || !ctx->Extensions.NV_fog_distance || + if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_fog_distance || (p != GL_EYE_RADIAL_NV && p != GL_EYE_PLANE && p != GL_EYE_PLANE_ABSOLUTE_NV)) { _mesa_error(ctx, GL_INVALID_ENUM, "glFog"); return; diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index e1ebd18569f..97dccd0edc1 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -395,7 +395,7 @@ print_table_stats(int api) int i, j, collisions[11], count, hash, mask; const struct value_desc *d; const char *api_names[] = { - [API_OPENGL] = "GL", + [API_OPENGL_COMPAT] = "GL", [API_OPENGL_CORE] = "GL_CORE", [API_OPENGLES] = "GLES", [API_OPENGLES2] = "GLES2", diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index a04db0dc708..20e7a014d12 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -40,7 +40,7 @@ static const GLubyte * shading_language_version(struct gl_context *ctx) { switch (ctx->API) { - case API_OPENGL: + case API_OPENGL_COMPAT: case API_OPENGL_CORE: if (!ctx->Extensions.ARB_shader_objects) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetString"); @@ -136,7 +136,7 @@ _mesa_GetString( GLenum name ) break; return shading_language_version(ctx); case GL_PROGRAM_ERROR_STRING_NV: - if (ctx->API == API_OPENGL && + if (ctx->API == API_OPENGL_COMPAT && (ctx->Extensions.ARB_fragment_program || ctx->Extensions.ARB_vertex_program)) { return (const GLubyte *) ctx->Program.ErrorString; @@ -205,52 +205,52 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) switch (pname) { case GL_VERTEX_ARRAY_POINTER: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Ptr; break; case GL_NORMAL_ARRAY_POINTER: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Ptr; break; case GL_COLOR_ARRAY_POINTER: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Ptr; break; case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Ptr; break; case GL_FOG_COORDINATE_ARRAY_POINTER_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Ptr; break; case GL_INDEX_ARRAY_POINTER: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr; break; case GL_TEXTURE_COORD_ARRAY_POINTER: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(clientUnit)].Ptr; break; case GL_EDGE_FLAG_ARRAY_POINTER: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr; break; case GL_FEEDBACK_BUFFER_POINTER: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = ctx->Feedback.Buffer; break; case GL_SELECTION_BUFFER_POINTER: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = ctx->Select.Buffer; break; diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 9089a725c32..69caef70b74 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -821,10 +821,10 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT: case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT: case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: - return ctx->API == API_OPENGL + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_compression_latc; case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI: - return ctx->API == API_OPENGL + return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ATI_texture_compression_3dc; case GL_ETC1_RGB8_OES: return _mesa_is_gles(ctx) diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index 90130e3dbbb..83d7966cd59 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -51,7 +51,7 @@ _mesa_Hint( GLenum target, GLenum mode ) switch (target) { case GL_FOG_HINT: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_target; if (ctx->Hint.Fog == mode) return; @@ -67,7 +67,7 @@ _mesa_Hint( GLenum target, GLenum mode ) ctx->Hint.LineSmooth = mode; break; case GL_PERSPECTIVE_CORRECTION_HINT: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_target; if (ctx->Hint.PerspectiveCorrection == mode) return; @@ -75,7 +75,7 @@ _mesa_Hint( GLenum target, GLenum mode ) ctx->Hint.PerspectiveCorrection = mode; break; case GL_POINT_SMOOTH_HINT: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_target; if (ctx->Hint.PointSmooth == mode) return; @@ -93,7 +93,7 @@ _mesa_Hint( GLenum target, GLenum mode ) /* GL_EXT_clip_volume_hint */ case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_target; if (ctx->Hint.ClipVolumeClipping == mode) return; diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index b0a10e9edd8..aae5d0ae947 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -466,7 +466,7 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params ) COPY_4V( ctx->Light.Model.Ambient, params ); break; case GL_LIGHT_MODEL_LOCAL_VIEWER: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; newbool = (params[0]!=0.0); if (ctx->Light.Model.LocalViewer == newbool) @@ -486,7 +486,7 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params ) ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; break; case GL_LIGHT_MODEL_COLOR_CONTROL: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; if (params[0] == (GLfloat) GL_SINGLE_COLOR) newenum = GL_SINGLE_COLOR; @@ -798,7 +798,7 @@ _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ) *params = mat[MAT_ATTRIB_SHININESS(f)][0]; break; case GL_COLOR_INDEXES: - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(pname)" ); return; } @@ -820,7 +820,7 @@ _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ) GLfloat (*mat)[4] = ctx->Light.Material.Attrib; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* update materials */ - ASSERT(ctx->API == API_OPENGL); + ASSERT(ctx->API == API_OPENGL_COMPAT); FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */ diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 00b8e00b75e..a4e5762377c 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -187,7 +187,7 @@ _mesa_MatrixMode( GLenum mode ) case GL_MATRIX5_ARB: case GL_MATRIX6_ARB: case GL_MATRIX7_ARB: - if (ctx->API == API_OPENGL + if (ctx->API == API_OPENGL_COMPAT && (ctx->Extensions.ARB_vertex_program || ctx->Extensions.ARB_fragment_program)) { const GLuint m = mode - GL_MATRIX0_ARB; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index da72da9d106..f34b3421b07 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3315,7 +3315,7 @@ struct gl_debug_state */ typedef enum { - API_OPENGL, /* legacy / compatibility contexts */ + API_OPENGL_COMPAT, /* legacy / compatibility contexts */ API_OPENGLES, API_OPENGLES2, API_OPENGL_CORE, diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 7d6e5a5e17f..b5fc5d5bb84 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -190,7 +190,7 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) /* GL_POINT_SPRITE_COORD_ORIGIN was added to point sprites when the * extension was merged into OpenGL 2.0. */ - if ((ctx->API == API_OPENGL && ctx->Version >= 20) + if ((ctx->API == API_OPENGL_COMPAT && ctx->Version >= 20) || ctx->API == API_OPENGL_CORE) { GLenum value = (GLenum) params[0]; if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) { diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index fecbd3f12a5..b5023e2607c 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -321,7 +321,7 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id) q = _mesa_lookup_query_object(ctx, id); if (!q) { - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQuery{Indexed}(non-gen name)"); return; diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 5c0a923e498..53e9d0486d1 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -452,7 +452,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param /* Is transform feedback available in this context? */ const bool has_xfb = - (ctx->API == API_OPENGL && ctx->Extensions.EXT_transform_feedback) + (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_transform_feedback) || ctx->API == API_OPENGL_CORE || _mesa_is_gles3(ctx); @@ -464,7 +464,7 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param /* Are uniform buffer objects available in this context? */ const bool has_ubo = - (ctx->API == API_OPENGL && ctx->Extensions.ARB_uniform_buffer_object) + (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_uniform_buffer_object) || ctx->API == API_OPENGL_CORE || _mesa_is_gles3(ctx); @@ -1728,7 +1728,7 @@ _mesa_init_shader_dispatch(const struct gl_context *ctx, SET_GetAttribLocation(exec, _mesa_GetAttribLocation); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT); SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT); SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT); diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index f1064c5e36c..e8f3af082a5 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -122,7 +122,7 @@ set_combiner_mode(struct gl_context *ctx, break; case GL_DOT3_RGB_EXT: case GL_DOT3_RGBA_EXT: - legal = (ctx->API == API_OPENGL && + legal = (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_env_dot3 && pname == GL_COMBINE_RGB); break; @@ -134,11 +134,11 @@ set_combiner_mode(struct gl_context *ctx, case GL_MODULATE_ADD_ATI: case GL_MODULATE_SIGNED_ADD_ATI: case GL_MODULATE_SUBTRACT_ATI: - legal = (ctx->API == API_OPENGL && + legal = (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ATI_texture_env_combine3); break; case GL_BUMP_ENVMAP_ATI: - legal = (ctx->API == API_OPENGL && + legal = (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ATI_envmap_bumpmap && pname == GL_COMBINE_RGB); break; @@ -206,7 +206,7 @@ set_combiner_source(struct gl_context *ctx, return; } - if ((term == 3) && (ctx->API != API_OPENGL + if ((term == 3) && (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_texture_env_combine4)) { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; @@ -236,12 +236,12 @@ set_combiner_source(struct gl_context *ctx, param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits); break; case GL_ZERO: - legal = (ctx->API == API_OPENGL && + legal = (ctx->API == API_OPENGL_COMPAT && (ctx->Extensions.ATI_texture_env_combine3 || ctx->Extensions.NV_texture_env_combine4)); break; case GL_ONE: - legal = (ctx->API == API_OPENGL && + legal = (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ATI_texture_env_combine3); break; default: @@ -293,7 +293,7 @@ set_combiner_operand(struct gl_context *ctx, return; } - if ((term == 3) && (ctx->API != API_OPENGL + if ((term == 3) && (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_texture_env_combine4)) { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; @@ -442,7 +442,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) set_combiner_scale(ctx, texUnit, pname, param[0]); break; case GL_BUMP_TARGET_ATI: - if (ctx->API != API_OPENGL || !ctx->Extensions.ATI_envmap_bumpmap) { + if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ATI_envmap_bumpmap) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname ); return; } @@ -588,7 +588,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit, return texUnit->Combine.SourceRGB[rgb_idx]; } case GL_SOURCE3_RGB_NV: - if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) { return texUnit->Combine.SourceRGB[3]; } else { @@ -602,7 +602,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit, return texUnit->Combine.SourceA[alpha_idx]; } case GL_SOURCE3_ALPHA_NV: - if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) { return texUnit->Combine.SourceA[3]; } else { @@ -616,7 +616,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit, return texUnit->Combine.OperandRGB[op_rgb]; } case GL_OPERAND3_RGB_NV: - if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) { return texUnit->Combine.OperandRGB[3]; } else { @@ -630,7 +630,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit, return texUnit->Combine.OperandA[op_alpha]; } case GL_OPERAND3_ALPHA_NV: - if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) { return texUnit->Combine.OperandA[3]; } else { @@ -643,7 +643,7 @@ get_texenvi(struct gl_context *ctx, const struct gl_texture_unit *texUnit, return 1 << texUnit->Combine.ScaleShiftA; case GL_BUMP_TARGET_ATI: /* spec doesn't say so, but I think this should be queryable */ - if (ctx->API == API_OPENGL && ctx->Extensions.ATI_envmap_bumpmap) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ATI_envmap_bumpmap) { return texUnit->BumpTarget; } else { diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 7c9c2a76023..fe5fc852da1 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -129,7 +129,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); return; } - if (ctx->API != API_OPENGL + if (ctx->API != API_OPENGL_COMPAT && (bit & (TEXGEN_REFLECTION_MAP_NV | TEXGEN_NORMAL_MAP_NV)) == 0) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); return; @@ -143,7 +143,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) case GL_OBJECT_PLANE: { - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); return; } @@ -158,7 +158,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) { GLfloat tmp[4]; - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" ); return; } @@ -352,14 +352,14 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) params[0] = ENUM_TO_FLOAT(texgen->Mode); break; case GL_OBJECT_PLANE: - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(param)" ); return; } COPY_4V(params, texgen->ObjectPlane); break; case GL_EYE_PLANE: - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(param)" ); return; } @@ -398,7 +398,7 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) params[0] = texgen->Mode; break; case GL_OBJECT_PLANE: - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(param)" ); return; } @@ -408,7 +408,7 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) params[3] = (GLint) texgen->ObjectPlane[3]; break; case GL_EYE_PLANE: - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(param)" ); return; } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 7d5a574e46b..a720c38b854 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1853,7 +1853,7 @@ texture_error_check( struct gl_context *ctx, /* Check border */ if (border < 0 || border > 1 || - ((ctx->API != API_OPENGL || + ((ctx->API != API_OPENGL_COMPAT || target == GL_TEXTURE_RECTANGLE_NV || target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -2353,7 +2353,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, /* Check border */ if (border < 0 || border > 1 || - ((ctx->API != API_OPENGL || + ((ctx->API != API_OPENGL_COMPAT || target == GL_TEXTURE_RECTANGLE_NV || target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) { _mesa_error(ctx, GL_INVALID_VALUE, diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 92c89102f37..c2d161f9a9d 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -64,7 +64,7 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) /* GL_CLAMP was removed in the core profile, and it has never existed in * OpenGL ES. */ - supported = (ctx->API == API_OPENGL) + supported = (ctx->API == API_OPENGL_COMPAT) && (target != GL_TEXTURE_EXTERNAL_OES); break; @@ -358,7 +358,7 @@ set_tex_parameteri(struct gl_context *ctx, return GL_TRUE; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_pname; if (params[0] && texObj->Target == GL_TEXTURE_EXTERNAL_OES) @@ -418,7 +418,7 @@ set_tex_parameteri(struct gl_context *ctx, /* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has never * existed in OpenGL ES. */ - if (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_texture) { + if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_texture) { if (texObj->DepthMode == params[0]) return GL_FALSE; if (params[0] == GL_LUMINANCE || @@ -562,7 +562,7 @@ set_tex_parameterf(struct gl_context *ctx, return GL_TRUE; case GL_TEXTURE_PRIORITY: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; flush(ctx); @@ -595,7 +595,7 @@ set_tex_parameterf(struct gl_context *ctx, * It was removed in core-profile, and it has never existed in OpenGL * ES. */ - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; if (texObj->Sampler.LodBias != params[0]) { @@ -1328,13 +1328,13 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) } break; case GL_TEXTURE_RESIDENT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = 1.0F; break; case GL_TEXTURE_PRIORITY: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = obj->Priority; @@ -1366,7 +1366,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = obj->Sampler.MaxAnisotropy; break; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLfloat) obj->GenerateMipmap; @@ -1387,12 +1387,12 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) /* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has * never existed in OpenGL ES. */ - if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_depth_texture) + if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_depth_texture) goto invalid_pname; *params = (GLfloat) obj->DepthMode; break; case GL_TEXTURE_LOD_BIAS: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = obj->Sampler.LodBias; @@ -1510,13 +1510,13 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) } break; case GL_TEXTURE_RESIDENT: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = 1; break; case GL_TEXTURE_PRIORITY: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = FLOAT_TO_INT(obj->Priority); @@ -1548,7 +1548,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) *params = (GLint) obj->Sampler.MaxAnisotropy; break; case GL_GENERATE_MIPMAP_SGIS: - if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) + if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLint) obj->GenerateMipmap; @@ -1566,12 +1566,12 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) *params = (GLint) obj->Sampler.CompareFunc; break; case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_depth_texture) + if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_depth_texture) goto invalid_pname; *params = (GLint) obj->DepthMode; break; case GL_TEXTURE_LOD_BIAS: - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) goto invalid_pname; *params = (GLint) obj->Sampler.LodBias; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index fe725889424..eef8f437d62 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -114,7 +114,7 @@ _mesa_override_gl_version(struct gl_context *ctx) } else if (ctx->Version >= 31) { ctx->API = API_OPENGL_CORE; } else { - ctx->API = API_OPENGL; + ctx->API = API_OPENGL_COMPAT; } create_version_string(ctx, ""); } @@ -344,7 +344,7 @@ _mesa_compute_version(struct gl_context *ctx) return; switch (ctx->API) { - case API_OPENGL: + case API_OPENGL_COMPAT: case API_OPENGL_CORE: compute_version(ctx); break; diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 5891a523161..674edb5e1cb 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -50,7 +50,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_Color4f(tab, vfmt->Color4f); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { _mesa_install_arrayelt_vtxfmt(tab, vfmt); SET_Color3f(tab, vfmt->Color3f); SET_Color3fv(tab, vfmt->Color3fv); @@ -58,7 +58,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_EdgeFlag(tab, vfmt->EdgeFlag); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { _mesa_install_eval_vtxfmt(tab, vfmt); } @@ -68,7 +68,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_Normal3f(tab, vfmt->Normal3f); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); SET_Indexf(tab, vfmt->Indexf); @@ -83,7 +83,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_Normal3fv(tab, vfmt->Normal3fv); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT); SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT); SET_TexCoord1f(tab, vfmt->TexCoord1f); @@ -102,7 +102,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_Vertex4fv(tab, vfmt->Vertex4fv); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { _mesa_install_dlist_vtxfmt(tab, vfmt); /* glCallList / glCallLists */ SET_Begin(tab, vfmt->Begin); @@ -145,7 +145,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, } /* Originally for GL_NV_vertex_program, this is also used by dlist.c */ - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV); SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV); @@ -189,7 +189,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_VertexAttribI4uivEXT(tab, vfmt->VertexAttribI4uiv); } - if (ctx->API == API_OPENGL) { + if (ctx->API == API_OPENGL_COMPAT) { /* GL_ARB_vertex_type_10_10_10_2_rev / GL 3.3 */ SET_VertexP2ui(tab, vfmt->VertexP2ui); SET_VertexP2uiv(tab, vfmt->VertexP2uiv); diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 7570d689494..62a736bb61b 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -527,7 +527,7 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.NV_texture_rectangle = GL_TRUE; ctx->Extensions.OES_EGL_image = GL_TRUE; - if (ctx->API != API_OPENGL) + if (ctx->API != API_OPENGL_COMPAT) ctx->Extensions.OES_EGL_image_external = GL_TRUE; ctx->Extensions.OES_draw_texture = GL_TRUE; diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index b58c1a358b4..0b9add95e69 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -615,7 +615,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, switch (attribs->profile) { case ST_PROFILE_DEFAULT: - api = API_OPENGL; + api = API_OPENGL_COMPAT; break; case ST_PROFILE_OPENGL_ES1: api = API_OPENGLES; diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index fd15fb6a9c3..7eda31e8f2b 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -189,7 +189,7 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx ) * vtxfmt mechanism can be removed now. */ vbo_exec_init( ctx ); - if (ctx->API == API_OPENGL) + if (ctx->API == API_OPENGL_COMPAT) vbo_save_init( ctx ); _math_init_eval(); @@ -221,7 +221,7 @@ void _vbo_DestroyContext( struct gl_context *ctx ) } vbo_exec_destroy(ctx); - if (ctx->API == API_OPENGL) + if (ctx->API == API_OPENGL_COMPAT) vbo_save_destroy(ctx); free(vbo); ctx->swtnl_im = NULL; diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 75e549fc419..2aaa2895ca6 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -465,10 +465,10 @@ vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) updateMats = ALL_MATERIAL_BITS; } - if (ctx->API == API_OPENGL && face == GL_FRONT) { + if (ctx->API == API_OPENGL_COMPAT && face == GL_FRONT) { updateMats &= FRONT_MATERIAL_BITS; } - else if (ctx->API == API_OPENGL && face == GL_BACK) { + else if (ctx->API == API_OPENGL_COMPAT && face == GL_BACK) { updateMats &= BACK_MATERIAL_BITS; } else if (face != GL_FRONT_AND_BACK) { @@ -514,7 +514,7 @@ vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params) MAT_ATTR(VBO_ATTRIB_MAT_BACK_SHININESS, 1, params); break; case GL_COLOR_INDEXES: - if (ctx->API != API_OPENGL) { + if (ctx->API != API_OPENGL_COMPAT) { _mesa_error(ctx, GL_INVALID_ENUM, "glMaterialfv(pname)"); return; }