Mesa (master): st/mesa: Make st_cb_drawtex.h FEATURE_OES_draw_texture aware .

Chia-I Wu olv at kemper.freedesktop.org
Wed May 12 04:31:48 UTC 2010


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

Author: Chia-I Wu <olv at lunarg.com>
Date:   Tue May 11 13:20:40 2010 +0800

st/mesa: Make st_cb_drawtex.h FEATURE_OES_draw_texture aware.

This change allows st_cb_drawtex.h to be used without knowing if
FEATURE_OES_draw_texture is enabled.

---

 src/mesa/state_tracker/st_cb_drawtex.c |   14 +++++++-------
 src/mesa/state_tracker/st_cb_drawtex.h |   19 +++++++++++++++++++
 src/mesa/state_tracker/st_context.c    |    6 ------
 3 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c
index 11c431c..18cebbc 100644
--- a/src/mesa/state_tracker/st_cb_drawtex.c
+++ b/src/mesa/state_tracker/st_cb_drawtex.c
@@ -34,6 +34,9 @@
 #include "cso_cache/cso_context.h"
 
 
+#if FEATURE_OES_draw_texture
+
+
 struct cached_shader
 {
    void *handle;
@@ -53,9 +56,6 @@ static struct cached_shader CachedShaders[MAX_SHADERS];
 static GLuint NumCachedShaders = 0;
 
 
-#if FEATURE_OES_draw_texture
-
-
 static void *
 lookup_shader(struct pipe_context *pipe,
               uint num_attribs,
@@ -281,13 +281,10 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
 }
 
 
-#endif /* FEATURE_OES_draw_texture */
-
-
 void
 st_init_drawtex_functions(struct dd_function_table *functions)
 {
-   _MESA_INIT_DRAWTEX_FUNCTIONS(functions, st_);
+   functions->DrawTex = st_DrawTex;
 }
 
 
@@ -303,3 +300,6 @@ st_destroy_drawtex(struct st_context *st)
    }
    NumCachedShaders = 0;
 }
+
+
+#endif /* FEATURE_OES_draw_texture */
diff --git a/src/mesa/state_tracker/st_cb_drawtex.h b/src/mesa/state_tracker/st_cb_drawtex.h
index 7b0da70..a3f54a3 100644
--- a/src/mesa/state_tracker/st_cb_drawtex.h
+++ b/src/mesa/state_tracker/st_cb_drawtex.h
@@ -9,10 +9,29 @@
 #ifndef ST_CB_DRAWTEX_H
 #define ST_CB_DRAWTEX_H
 
+
+#include "main/mtypes.h"
+
+#if FEATURE_OES_draw_texture
+
 extern void
 st_init_drawtex_functions(struct dd_function_table *functions);
 
 extern void
 st_destroy_drawtex(struct st_context *st);
 
+#else
+
+static INLINE void
+st_init_drawtex_functions(struct dd_function_table *functions)
+{
+}
+
+static INLINE void
+st_destroy_drawtex(struct st_context *st)
+{
+}
+
+#endif /* FEATURE_OES_draw_texture */
+
 #endif /* ST_CB_DRAWTEX_H */
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 08963b4..21d0fa9 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -40,9 +40,7 @@
 #include "st_cb_condrender.h"
 #include "st_cb_drawpixels.h"
 #include "st_cb_rasterpos.h"
-#if FEATURE_OES_draw_texture
 #include "st_cb_drawtex.h"
-#endif
 #include "st_cb_eglimage.h"
 #include "st_cb_fbo.h"
 #include "st_cb_feedback.h"
@@ -216,9 +214,7 @@ static void st_destroy_context_priv( struct st_context *st )
    st_destroy_clear(st);
    st_destroy_bitmap(st);
    st_destroy_drawpix(st);
-#if FEATURE_OES_draw_texture
    st_destroy_drawtex(st);
-#endif
 
    for (i = 0; i < Elements(st->state.sampler_views); i++) {
       pipe_sampler_view_reference(&st->state.sampler_views[i], NULL);
@@ -286,9 +282,7 @@ void st_init_driver_functions(struct dd_function_table *functions)
    st_init_drawpixels_functions(functions);
    st_init_rasterpos_functions(functions);
 
-#if FEATURE_OES_draw_texture
    st_init_drawtex_functions(functions);
-#endif
 
    st_init_eglimage_functions(functions);
 




More information about the mesa-commit mailing list