[Mesa-dev] [PATCH] mesa: Rename API_OPENGL to API_OPENGL_COMPAT.

Paul Berry stereotype441 at gmail.com
Tue Nov 27 12:44:33 PST 2012


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.
--
Note: this patch is huge, so I've just included a few representative
hunks.  To see the full patch in context, please check out branch
"rename_api" from git://github.com/stereotype441/mesa.git.

 .../state_trackers/dri/common/dri_context.c        |   2 +-
 src/glsl/builtins/tools/generate_builtins.py       |   2 +-
 src/glsl/glcpp/glcpp.c                             |   2 +-
 src/glsl/main.cpp                                  |   2 +-
 src/glsl/test_optpass.cpp                          |   2 +-
 src/mapi/glapi/gen/gl_genexec.py                   |   2 +-
 src/mesa/drivers/common/meta.c                     |  26 +--
 src/mesa/drivers/dri/common/dri_util.c             |  12 +-
 src/mesa/drivers/dri/common/drisw_util.c           |   2 +-
 src/mesa/drivers/dri/i915/i915_context.c           |   2 +-
 src/mesa/drivers/dri/i965/brw_context.c            |   2 +-
 src/mesa/drivers/dri/intel/intel_screen.c          |   2 +-
 src/mesa/drivers/dri/nouveau/nouveau_context.c     |   4 +-
 src/mesa/drivers/dri/r200/r200_context.c           |   2 +-
 .../drivers/dri/radeon/radeon_common_context.c     |   2 +-
 src/mesa/drivers/dri/radeon/radeon_context.c       |   2 +-
 src/mesa/drivers/dri/swrast/swrast.c               |   4 +-
 src/mesa/drivers/osmesa/osmesa.c                   |   2 +-
 src/mesa/drivers/windows/gdi/wmesa.c               |   2 +-
 src/mesa/drivers/x11/xm_api.c                      |   2 +-
 src/mesa/main/api_loopback.c                       |   4 +-
 src/mesa/main/api_validate.c                       |   4 +-
 src/mesa/main/attrib.c                             |   2 +-
 src/mesa/main/buffers.c                            |   2 +-
 src/mesa/main/context.c                            |   2 +-
 src/mesa/main/context.h                            |   2 +-
 src/mesa/main/enable.c                             | 196 ++++++++++-----------
 src/mesa/main/extensions.c                         |   4 +-
 src/mesa/main/fbobject.c                           |  52 +++---
 src/mesa/main/fog.c                                |   6 +-
 src/mesa/main/get.c                                |   2 +-
 src/mesa/main/getstring.c                          |  24 +--
 src/mesa/main/glformats.c                          |   4 +-
 src/mesa/main/hint.c                               |   8 +-
 src/mesa/main/light.c                              |   8 +-
 src/mesa/main/matrix.c                             |   2 +-
 src/mesa/main/mtypes.h                             |   2 +-
 src/mesa/main/points.c                             |   2 +-
 src/mesa/main/queryobj.c                           |   2 +-
 src/mesa/main/shaderapi.c                          |   6 +-
 src/mesa/main/texenv.c                             |  26 +--
 src/mesa/main/texgen.c                             |  14 +-
 src/mesa/main/teximage.c                           |   4 +-
 src/mesa/main/texparam.c                           |  30 ++--
 src/mesa/main/version.c                            |   4 +-
 src/mesa/main/vtxfmt.c                             |  14 +-
 src/mesa/state_tracker/st_extensions.c             |   2 +-
 src/mesa/state_tracker/st_manager.c                |   2 +-
 src/mesa/vbo/vbo_context.c                         |   4 +-
 src/mesa/vbo/vbo_exec_api.c                        |   6 +-
 50 files changed, 259 insertions(+), 259 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_context.c b/src/gallium/state_trackers/dri/common/dri_context.c
index b91303d..63ef9e3 100644
--- a/src/gallium/state_trackers/dri/common/dri_context.c
+++ b/src/gallium/state_trackers/dri/common/dri_context.c
@@ -81,7 +81,7 @@ 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:
       attribs.profile = ST_PROFILE_DEFAULT;
       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 7eccb7d..0b7f6a0 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 35db470..7c2ded8 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 04143ad..33cd79c 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;
 
(...lots of boring hunks omitted...)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index da72da9..f34b342 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,

(...lots more boring hunks omitted...)



More information about the mesa-dev mailing list