[Mesa-dev] [PATCH 2/6] mesa: remove #if _HAVE_FULL_GL checks

Brian Paul brian.e.paul at gmail.com
Sat Sep 22 17:45:33 PDT 2012


From: Brian Paul <brianp at vmware.com>

This is basically more of the "remove FEATURE_x" clean-up.
---
 src/mesa/main/blend.c       |   10 +---------
 src/mesa/main/clear.c       |    2 --
 src/mesa/main/context.c     |    8 --------
 src/mesa/main/debug.h       |   15 ---------------
 src/mesa/main/depth.h       |    9 ---------
 src/mesa/main/drawpix.c     |    2 --
 src/mesa/main/extensions.h  |   19 -------------------
 src/mesa/main/feedback.c    |    4 ----
 src/mesa/main/fog.h         |    9 ---------
 src/mesa/main/hint.h        |    9 ---------
 src/mesa/main/light.h       |   11 -----------
 src/mesa/main/matrix.c      |    4 ----
 src/mesa/main/points.c      |    4 ----
 src/mesa/main/polygon.c     |    3 ---
 src/mesa/main/stencil.c     |    2 --
 src/mesa/main/texcompress.h |   11 -----------
 src/mesa/main/teximage.c    |    2 --
 src/mesa/main/varray.h      |   10 ----------
 18 files changed, 1 insertions(+), 133 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index de871a9..5d68fd9 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -256,9 +256,6 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB,
 }
 
 
-#if _HAVE_FULL_GL
-
-
 /**
  * Set blend source/dest factors for one color buffer/target.
  */
@@ -520,10 +517,6 @@ _mesa_BlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeA)
 }
 
 
-
-#endif /* _HAVE_FULL_GL */
-
-
 /**
  * Set the blending color.
  *
@@ -666,7 +659,7 @@ _mesa_LogicOp( GLenum opcode )
       ctx->Driver.LogicOpcode( ctx, opcode );
 }
 
-#if _HAVE_FULL_GL
+
 void GLAPIENTRY
 _mesa_IndexMask( GLuint mask )
 {
@@ -679,7 +672,6 @@ _mesa_IndexMask( GLuint mask )
    FLUSH_VERTICES(ctx, _NEW_COLOR);
    ctx->Color.IndexMask = mask;
 }
-#endif
 
 
 /**
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index f07d533..83ffdf6 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -41,7 +41,6 @@
 
 
 
-#if _HAVE_FULL_GL
 void GLAPIENTRY
 _mesa_ClearIndex( GLfloat c )
 {
@@ -54,7 +53,6 @@ _mesa_ClearIndex( GLfloat c )
    FLUSH_VERTICES(ctx, _NEW_COLOR);
    ctx->Color.ClearIndex = (GLuint) c;
 }
-#endif
 
 
 /**
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index abce52e..f645e2b 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -129,9 +129,7 @@
 #include "vtxfmt.h"
 #include "program/program.h"
 #include "program/prog_print.h"
-#if _HAVE_FULL_GL
 #include "math/m_matrix.h"
-#endif
 #include "main/dispatch.h" /* for _gloffset_COUNT */
 
 #ifdef USE_SPARC_ASM
@@ -1168,7 +1166,6 @@ _mesa_destroy_context( struct gl_context *ctx )
 }
 
 
-#if _HAVE_FULL_GL
 /**
  * Copy attribute groups from one context to another.
  * 
@@ -1289,7 +1286,6 @@ _mesa_copy_context( const struct gl_context *src, struct gl_context *dst,
    dst->NewState = _NEW_ALL;
    dst->NewDriverState = ~0;
 }
-#endif
 
 
 /**
@@ -1466,8 +1462,6 @@ _mesa_make_current( struct gl_context *newCtx,
 
 #if 1
          /* We want to get rid of these lines: */
-
-#if _HAVE_FULL_GL
          if (!drawBuffer->Initialized) {
             initialize_framebuffer_size(newCtx, drawBuffer);
          }
@@ -1476,8 +1470,6 @@ _mesa_make_current( struct gl_context *newCtx,
          }
 
 	 _mesa_resizebuffers(newCtx);
-#endif
-
 #else
          /* We want the drawBuffer and readBuffer to be initialized by
           * the driver.
diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h
index bc64a83..6bc5365 100644
--- a/src/mesa/main/debug.h
+++ b/src/mesa/main/debug.h
@@ -42,27 +42,12 @@
 struct gl_context;
 struct gl_texture_image;
 
-#if _HAVE_FULL_GL
-
 extern void _mesa_print_tri_caps( const char *name, GLuint flags );
 extern void _mesa_print_enable_flags( const char *msg, GLuint flags );
 extern void _mesa_print_state( const char *msg, GLuint state );
 extern void _mesa_print_info( void );
 extern void _mesa_init_debug( struct gl_context *ctx );
 
-#else
-
-/** No-op */
-#define _mesa_print_state( m, s ) ((void)0)
-
-/** No-op */
-#define _mesa_print_info() ((void)0)
-
-/** No-op */
-#define _mesa_init_debug( c ) ((void)0)
-
-#endif
-
 extern void
 _mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb);
 
diff --git a/src/mesa/main/depth.h b/src/mesa/main/depth.h
index 2f42862..fe6b33f 100644
--- a/src/mesa/main/depth.h
+++ b/src/mesa/main/depth.h
@@ -38,8 +38,6 @@
 struct gl_context;
 
 
-#if _HAVE_FULL_GL
-
 extern void GLAPIENTRY
 _mesa_ClearDepth( GLclampd depth );
 
@@ -58,11 +56,4 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax );
 extern void 
 _mesa_init_depth( struct gl_context * ctx );
 
-#else
-
-/** No-op */
-#define _mesa_init_depth( c ) ((void)0)
-
-#endif
-
 #endif
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index b5ab2cb..8836e0a 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -344,7 +344,6 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
          ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap );
       }
    }
-#if _HAVE_FULL_GL
    else if (ctx->RenderMode == GL_FEEDBACK) {
       FLUSH_CURRENT(ctx, 0);
       _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN );
@@ -357,7 +356,6 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
       ASSERT(ctx->RenderMode == GL_SELECT);
       /* Do nothing.  See OpenGL Spec, Appendix B, Corollary 6. */
    }
-#endif
 
    /* update raster position */
    ctx->Current.RasterPos[0] += xmove;
diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h
index 712c6e9..8acbd4b 100644
--- a/src/mesa/main/extensions.h
+++ b/src/mesa/main/extensions.h
@@ -41,8 +41,6 @@
 
 struct gl_context;
 
-#if _HAVE_FULL_GL
-
 extern void _mesa_enable_sw_extensions(struct gl_context *ctx);
 
 extern void _mesa_enable_1_3_extensions(struct gl_context *ctx);
@@ -71,21 +69,4 @@ _mesa_get_extension_count(struct gl_context *ctx);
 extern const GLubyte *
 _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index);
 
-
-#else
-
-/** No-op */
-#define _mesa_extensions_dtr( ctx ) ((void)0)
-
-/** No-op */
-#define _mesa_extensions_ctr( ctx ) ((void)0)
-
-/** No-op */
-#define _mesa_extensions_get_string( ctx ) "GL_EXT_texture_object"
-
-/** No-op */
-#define _mesa_enable_extension( c, n ) ((void)0)
-
-#endif
-
 #endif
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index 8a63acd..f45b823 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -449,7 +449,6 @@ _mesa_RenderMode( GLenum mode )
 	 ctx->Select.Hits = 0;
 	 ctx->Select.NameStackDepth = 0;
 	 break;
-#if _HAVE_FULL_GL
       case GL_FEEDBACK:
 	 if (ctx->Feedback.Count > ctx->Feedback.BufferSize) {
 	    /* overflow */
@@ -460,7 +459,6 @@ _mesa_RenderMode( GLenum mode )
 	 }
 	 ctx->Feedback.Count = 0;
 	 break;
-#endif
       default:
 	 _mesa_error( ctx, GL_INVALID_ENUM, "glRenderMode" );
 	 return 0;
@@ -475,14 +473,12 @@ _mesa_RenderMode( GLenum mode )
 	    _mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" );
 	 }
 	 break;
-#if _HAVE_FULL_GL
       case GL_FEEDBACK:
 	 if (ctx->Feedback.BufferSize==0) {
 	    /* haven't called glFeedbackBuffer yet */
 	    _mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" );
 	 }
 	 break;
-#endif
       default:
 	 _mesa_error( ctx, GL_INVALID_ENUM, "glRenderMode" );
 	 return 0;
diff --git a/src/mesa/main/fog.h b/src/mesa/main/fog.h
index 9191a4a..20a75e9 100644
--- a/src/mesa/main/fog.h
+++ b/src/mesa/main/fog.h
@@ -43,8 +43,6 @@
 struct gl_context;
 
 
-#if _HAVE_FULL_GL
-
 extern void GLAPIENTRY
 _mesa_Fogf(GLenum pname, GLfloat param);
 
@@ -59,11 +57,4 @@ _mesa_Fogiv(GLenum pname, const GLint *params );
 
 extern void _mesa_init_fog( struct gl_context * ctx );
 
-#else
-
-/** No-op */
-#define _mesa_init_fog( c ) ((void)0)
-
-#endif
-
 #endif
diff --git a/src/mesa/main/hint.h b/src/mesa/main/hint.h
index 6c62068..ca9659d 100644
--- a/src/mesa/main/hint.h
+++ b/src/mesa/main/hint.h
@@ -41,19 +41,10 @@
 
 struct gl_context;
 
-#if _HAVE_FULL_GL
-
 extern void GLAPIENTRY
 _mesa_Hint( GLenum target, GLenum mode );
 
 extern void 
 _mesa_init_hint( struct gl_context * ctx );
 
-#else
-
-/** No-op */
-#define _mesa_init_hint( c ) ((void) 0)
-
-#endif
-
 #endif
diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h
index c751d6d..2e6a500 100644
--- a/src/mesa/main/light.h
+++ b/src/mesa/main/light.h
@@ -42,7 +42,6 @@ extern void GLAPIENTRY
 _mesa_ProvokingVertexEXT(GLenum mode);
 
 
-#if _HAVE_FULL_GL
 extern void GLAPIENTRY
 _mesa_ColorMaterial( GLenum face, GLenum mode );
 
@@ -108,14 +107,4 @@ extern void _mesa_free_lighting_data( struct gl_context *ctx );
 
 extern void _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag );
 
-#else
-#define _mesa_update_color_material( c, r ) ((void)0)
-#define _mesa_material_bitmask( c, f, p, l, s ) 0
-#define _mesa_init_lighting( c ) ((void)0)
-#define _mesa_free_lighting_data( c ) ((void)0)
-#define _mesa_update_lighting( c ) ((void)0)
-#define _mesa_update_tnl_spaces( c, n ) ((void)0)
-#define GET_SHINE_TAB_ENTRY( table, dp, result )  ((result)=0)
-#endif
-
 #endif
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 76f5ea7..db84c01 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -460,7 +460,6 @@ _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
 }
 
  
-#if _HAVE_FULL_GL
 void GLAPIENTRY
 _mesa_LoadMatrixd( const GLdouble *m )
 {
@@ -503,10 +502,8 @@ _mesa_Translated( GLdouble x, GLdouble y, GLdouble z )
 {
    _mesa_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
 }
-#endif
 
 
-#if _HAVE_FULL_GL
 void GLAPIENTRY
 _mesa_LoadTransposeMatrixfARB( const GLfloat *m )
 {
@@ -545,7 +542,6 @@ _mesa_MultTransposeMatrixdARB( const GLdouble *m )
    _math_transposefd(tm, m);
    _mesa_MultMatrixf(tm);
 }
-#endif
 
 
 
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 538f3cf..7d6e5a5 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -62,9 +62,6 @@ _mesa_PointSize( GLfloat size )
 }
 
 
-#if _HAVE_FULL_GL
-
-
 void GLAPIENTRY
 _mesa_PointParameteri( GLenum pname, GLint param )
 {
@@ -221,7 +218,6 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params)
    if (ctx->Driver.PointParameterfv)
       (*ctx->Driver.PointParameterfv)(ctx, pname, params);
 }
-#endif
 
 
 
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index d7d52da..eb53f8a 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -184,8 +184,6 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
       ctx->Driver.PolygonMode(ctx, face, mode);
 }
 
-#if _HAVE_FULL_GL
-
 
 /**
  * This routine updates the ctx->Polygon.Stipple state.
@@ -298,7 +296,6 @@ _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
    _mesa_PolygonOffset(factor, bias * ctx->DrawBuffer->_DepthMaxF );
 }
 
-#endif
 
 
 /**********************************************************************/
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index f47b57b..8d2948b 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -382,7 +382,6 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
 
 
 
-#if _HAVE_FULL_GL
 /* GL_EXT_stencil_two_side */
 void GLAPIENTRY
 _mesa_ActiveStencilFaceEXT(GLenum face)
@@ -406,7 +405,6 @@ _mesa_ActiveStencilFaceEXT(GLenum face)
       _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)");
    }
 }
-#endif
 
 
 
diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h
index 34f4fae..359b916 100644
--- a/src/mesa/main/texcompress.h
+++ b/src/mesa/main/texcompress.h
@@ -31,8 +31,6 @@
 
 struct gl_context;
 
-#if _HAVE_FULL_GL
-
 extern GLenum
 _mesa_gl_compressed_format_base_format(GLenum format);
 
@@ -55,13 +53,4 @@ _mesa_decompress_image(gl_format format, GLuint width, GLuint height,
                        const GLubyte *src, GLint srcRowStride,
                        GLfloat *dest);
 
-#else /* _HAVE_FULL_GL */
-
-/* no-op macros */
-#define _mesa_get_compressed_formats( c, f ) 0
-#define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0
-#define _mesa_compress_teximage( c, w, h, sF, s, sRS, dF, d, drs ) ((void)0)
-
-#endif /* _HAVE_FULL_GL */
-
 #endif /* TEXCOMPRESS_H */
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 0770445..9656cb2 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1957,7 +1957,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:
@@ -2000,7 +1999,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
        */
       level = -level;
       break;
-#endif
 
    default:
       choose_format = GL_NONE;
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index d483612..1053299 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -65,8 +65,6 @@ _mesa_update_array_max_element(struct gl_client_array *array)
 }
 
 
-#if _HAVE_FULL_GL
-
 extern void GLAPIENTRY
 _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride,
                     const GLvoid *ptr);
@@ -271,12 +269,4 @@ _mesa_init_varray( struct gl_context * ctx );
 extern void 
 _mesa_free_varray_data(struct gl_context *ctx);
 
-#else
-
-/** No-op */
-#define _mesa_init_varray( c )  ((void)0)
-#define _mesa_free_varray_data( c )  ((void)0)
-
-#endif
-
 #endif
-- 
1.7.4.1



More information about the mesa-dev mailing list