Mesa (master): st/mesa: Make st_cb_accum.h FEATURE_accum aware.

Chia-I Wu olv at kemper.freedesktop.org
Tue May 11 21:31:47 PDT 2010


Module: Mesa
Branch: master
Commit: e33ad4999e5f8a690a72ad6ce4e6d36328173430
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e33ad4999e5f8a690a72ad6ce4e6d36328173430

Author: Chia-I Wu <olv at lunarg.com>
Date:   Wed Mar 31 11:43:49 2010 +0800

st/mesa: Make st_cb_accum.h FEATURE_accum aware.

This change allows st_cb_accum.h to be used without knowing if
FEATURE_accum is enabled.

---

 src/mesa/state_tracker/st_cb_accum.c |    4 ++++
 src/mesa/state_tracker/st_cb_accum.h |   18 ++++++++++++++++++
 src/mesa/state_tracker/st_context.c  |    2 --
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c
index ded0ba9..425e798 100644
--- a/src/mesa/state_tracker/st_cb_accum.c
+++ b/src/mesa/state_tracker/st_cb_accum.c
@@ -45,6 +45,8 @@
 #include "util/u_tile.h"
 
 
+#if FEATURE_accum
+
 /**
  * For hardware that supports deep color buffers, we could accelerate
  * most/all the accum operations with blending/texturing.
@@ -333,3 +335,5 @@ void st_init_accum_functions(struct dd_function_table *functions)
 {
    functions->Accum = st_Accum;
 }
+
+#endif /* FEATURE_accum */
diff --git a/src/mesa/state_tracker/st_cb_accum.h b/src/mesa/state_tracker/st_cb_accum.h
index ed9b7da..7d52481 100644
--- a/src/mesa/state_tracker/st_cb_accum.h
+++ b/src/mesa/state_tracker/st_cb_accum.h
@@ -30,10 +30,28 @@
 #define ST_CB_ACCUM_H
 
 
+#include "main/mtypes.h"
+
+#if FEATURE_accum
+
 extern void
 st_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb);
 
 extern void st_init_accum_functions(struct dd_function_table *functions);
 
+#else
+
+static INLINE void
+st_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
+{
+   ASSERT_NO_FEATURE();
+}
+
+static INLINE void
+st_init_accum_functions(struct dd_function_table *functions)
+{
+}
+
+#endif /* FEATURE_accum */
 
 #endif /* ST_CB_ACCUM_H */
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 806f877..24360fa 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -302,9 +302,7 @@ void st_init_driver_functions(struct dd_function_table *functions)
 {
    _mesa_init_glsl_driver_functions(functions);
 
-#if FEATURE_accum
    st_init_accum_functions(functions);
-#endif
 #if FEATURE_EXT_framebuffer_blit
    st_init_blit_functions(functions);
 #endif



More information about the mesa-commit mailing list