[Mesa-dev] [PATCH 46/47] mesa: remove remaining FEATURE_* defines where protected by API check.

Oliver McFadden oliver.mcfadden at linux.intel.com
Thu Sep 13 01:19:15 PDT 2012


Signed-off-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>
---
 src/gallium/targets/egl-static/egl_st.c |    2 --
 src/mesa/main/buffers.c                 |    2 --
 src/mesa/main/context.c                 |    4 ----
 src/mesa/main/enable.c                  |    7 +------
 src/mesa/main/get.c                     |    2 --
 src/mesa/main/glformats.c               |    2 --
 src/mesa/main/shaderapi.c               |    4 ----
 src/mesa/main/texcompress.c             |    2 --
 src/mesa/main/teximage.c                |    6 +-----
 9 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/src/gallium/targets/egl-static/egl_st.c b/src/gallium/targets/egl-static/egl_st.c
index 67e3c29..8c06fb7 100644
--- a/src/gallium/targets/egl-static/egl_st.c
+++ b/src/gallium/targets/egl-static/egl_st.c
@@ -129,13 +129,11 @@ egl_st_create_api(enum st_api_type api)
 
    switch (api) {
    case ST_API_OPENGL:
-#if FEATURE_GL || FEATURE_ES1 || FEATURE_ES2
 #if _EGL_EXTERNAL_GL
       stapi = egl_st_load_gl();
 #else
       stapi = st_gl_api_create();
 #endif
-#endif
       break;
    case ST_API_OPENVG:
 #if FEATURE_VG
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 216b6ee..cc268b6 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -353,7 +353,6 @@ updated_drawbuffers(struct gl_context *ctx)
 {
    FLUSH_VERTICES(ctx, _NEW_BUFFERS);
 
-#if FEATURE_GL
    if (ctx->API == API_OPENGL && !ctx->Extensions.ARB_ES2_compatibility) {
       struct gl_framebuffer *fb = ctx->DrawBuffer;
 
@@ -362,7 +361,6 @@ updated_drawbuffers(struct gl_context *ctx)
 	 fb->_Status = 0;
       }
    }
-#endif
 }
 
 
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index abce52e..63bb3da 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -952,18 +952,14 @@ _mesa_initialize_context(struct gl_context *ctx,
 
    /* setup the API dispatch tables */
    switch (ctx->API) {
-#if FEATURE_GL || FEATURE_ES2
    case API_OPENGL:
    case API_OPENGL_CORE:
    case API_OPENGLES2:
       ctx->Exec = _mesa_create_exec_table(ctx);
       break;
-#endif
-#if FEATURE_ES1
    case API_OPENGLES:
       ctx->Exec = _mesa_create_exec_table_es1();
       break;
-#endif
    default:
       _mesa_problem(ctx, "unknown or unsupported API");
       break;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 6a7f8a0..c1b6daf 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -700,7 +700,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          }
          break;
 
-#if FEATURE_ES1
       case GL_TEXTURE_GEN_STR_OES:
 	 /* disable S, T, and R at the same time */
 	 {
@@ -721,7 +720,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             }
          }
          break;
-#endif
 
       /* client-side state */
       case GL_VERTEX_ARRAY:
@@ -1420,7 +1418,7 @@ _mesa_IsEnabled( GLenum cap )
             }
          }
          return GL_FALSE;
-#if FEATURE_ES1
+
       case GL_TEXTURE_GEN_STR_OES:
 	 {
             const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
@@ -1433,7 +1431,6 @@ _mesa_IsEnabled( GLenum cap )
                   ? GL_TRUE : GL_FALSE;
             }
          }
-#endif
 
       /* client-side state */
       case GL_VERTEX_ARRAY:
@@ -1471,12 +1468,10 @@ _mesa_IsEnabled( GLenum cap )
             goto invalid_enum_error;
          CHECK_EXTENSION(EXT_secondary_color);
          return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0);
-#if FEATURE_ES
       case GL_POINT_SIZE_ARRAY_OES:
          if (ctx->API != API_OPENGLES)
             goto invalid_enum_error;
          return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0);
-#endif
 
       /* GL_ARB_texture_cube_map */
       case GL_TEXTURE_CUBE_MAP_ARB:
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index a3d4679..3c1d4d3 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2707,7 +2707,6 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
    }
 }
 
-#if FEATURE_ES1
 void GLAPIENTRY
 _mesa_GetFixedv(GLenum pname, GLfixed *params)
 {
@@ -2793,4 +2792,3 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params)
       break;
    }
 }
-#endif
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 047a613..ec774f6 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -827,7 +827,6 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format)
    case GL_ETC1_RGB8_OES:
       return _mesa_is_gles(ctx)
          && ctx->Extensions.OES_compressed_ETC1_RGB8_texture;
-#if FEATURE_ES
    case GL_PALETTE4_RGB8_OES:
    case GL_PALETTE4_RGBA8_OES:
    case GL_PALETTE4_R5_G6_B5_OES:
@@ -839,7 +838,6 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format)
    case GL_PALETTE8_RGBA4_OES:
    case GL_PALETTE8_RGB5_A1_OES:
       return ctx->API == API_OPENGLES;
-#endif
    default:
       return GL_FALSE;
    }
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c2ec1fa..72a65d7 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1430,8 +1430,6 @@ _mesa_ValidateProgramARB(GLhandleARB program)
    validate_program(ctx, program);
 }
 
-#ifdef FEATURE_ES2
-
 void GLAPIENTRY
 _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
                                GLint* range, GLint* precision)
@@ -1504,8 +1502,6 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
    _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__);
 }
 
-#endif /* FEATURE_ES2 */
-
 
 void GLAPIENTRY
 _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value)
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index bb61e6e..957cc6d 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -275,7 +275,6 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
       }
    }
 
-#if FEATURE_ES1
    if (ctx->API == API_OPENGLES) {
       if (formats) {
 	 formats[n++] = GL_PALETTE4_RGB8_OES;
@@ -293,7 +292,6 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
 	 n += 10;
       }
    }
-#endif
 
    return n;
 }
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index da8fbcd..8143c52 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1954,7 +1954,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
    }
 
    switch (internalFormat) {
-#if FEATURE_ES
    case GL_PALETTE4_RGB8_OES:
    case GL_PALETTE4_RGBA8_OES:
    case GL_PALETTE4_R5_G6_B5_OES:
@@ -1997,7 +1996,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
        */
       level = -level;
       break;
-#endif
 
    default:
       choose_format = GL_NONE;
@@ -2947,12 +2945,11 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
                                   format, type, width, height, depth, border);
    }
 
-#if FEATURE_ES
    /* Here we convert a cpal compressed image into a regular glTexImage2D
     * call by decompressing the texture.  If we really want to support cpal
     * textures in any driver this would have to be changed.
     */
-   if (compressed && !error && dims == 2) {
+   if (ctx->API == API_OPENGLES && compressed && !error && dims == 2) {
       switch (internalFormat) {
       case GL_PALETTE4_RGB8_OES:
       case GL_PALETTE4_RGBA8_OES:
@@ -2969,7 +2966,6 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
          return;
       }
    }
-#endif
 
    if (_mesa_is_proxy_texture(target)) {
       /* Proxy texture: just clear or set state depending on error checking */
-- 
1.7.8.6



More information about the mesa-dev mailing list