Mesa (master): mesa: Less FEATURE_ARB_sync tests.

Chia-I Wu olv at kemper.freedesktop.org
Tue Sep 14 08:50:24 UTC 2010


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

Author: Chia-I Wu <olv at lunarg.com>
Date:   Mon Sep 13 13:35:12 2010 +0800

mesa: Less FEATURE_ARB_sync tests.

Add dummy static inline definitions to syncobj.h when FEATURE_ARB_sync
is 0, and remove most FEATURE_ARB_sync tests.

---

 src/mesa/main/api_exec.c |   12 +-----------
 src/mesa/main/context.c  |    6 ------
 src/mesa/main/shared.c   |    6 ------
 src/mesa/main/syncobj.c  |   15 +++++++++++++++
 src/mesa/main/syncobj.h  |   46 ++++++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 60 insertions(+), 25 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 82e1f0f..c3c710f 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -101,9 +101,7 @@
 #include "shaderapi.h"
 #include "uniforms.h"
 #endif
-#if FEATURE_ARB_sync
 #include "syncobj.h"
-#endif
 #include "main/dispatch.h"
 
 
@@ -634,15 +632,7 @@ _mesa_create_exec_table(void)
 #endif
 
    /* GL_ARB_sync */
-#if FEATURE_ARB_sync
-   SET_IsSync(exec, _mesa_IsSync);
-   SET_DeleteSync(exec, _mesa_DeleteSync);
-   SET_FenceSync(exec, _mesa_FenceSync);
-   SET_ClientWaitSync(exec, _mesa_ClientWaitSync);
-   SET_WaitSync(exec, _mesa_WaitSync);
-   SET_GetInteger64v(exec, _mesa_GetInteger64v);
-   SET_GetSynciv(exec, _mesa_GetSynciv);
-#endif
+   _mesa_init_sync_dispatch(exec);
 
   /* GL_ATI_fragment_shader */
    _mesa_init_ati_fragment_shader_dispatch(exec);
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 979bc40..b1f800f 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -111,9 +111,7 @@
 #include "points.h"
 #include "polygon.h"
 #include "queryobj.h"
-#if FEATURE_ARB_sync
 #include "syncobj.h"
-#endif
 #include "rastpos.h"
 #include "remap.h"
 #include "scissor.h"
@@ -737,9 +735,7 @@ init_attrib_groups(GLcontext *ctx)
    _mesa_init_polygon( ctx );
    _mesa_init_program( ctx );
    _mesa_init_queryobj( ctx );
-#if FEATURE_ARB_sync
    _mesa_init_sync( ctx );
-#endif
    _mesa_init_rastpos( ctx );
    _mesa_init_scissor( ctx );
    _mesa_init_shader_state( ctx );
@@ -1100,9 +1096,7 @@ _mesa_free_context_data( GLcontext *ctx )
    _mesa_free_program_data(ctx);
    _mesa_free_shader_state(ctx);
    _mesa_free_queryobj_data(ctx);
-#if FEATURE_ARB_sync
    _mesa_free_sync_data(ctx);
-#endif
    _mesa_free_varray_data(ctx);
    _mesa_free_transform_feedback(ctx);
 
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index ea7e503..a56c70f 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -40,9 +40,7 @@
 #include "program/program.h"
 #include "dlist.h"
 #include "shaderobj.h"
-#if FEATURE_ARB_sync
 #include "syncobj.h"
-#endif
 
 /**
  * Allocate and initialize a shared context state structure.
@@ -122,9 +120,7 @@ _mesa_alloc_shared_state(GLcontext *ctx)
    shared->RenderBuffers = _mesa_NewHashTable();
 #endif
 
-#if FEATURE_ARB_sync
    make_empty_list(& shared->SyncObjects);
-#endif
 
    return shared;
 }
@@ -337,7 +333,6 @@ free_shared_state(GLcontext *ctx, struct gl_shared_state *shared)
    _mesa_reference_buffer_object(ctx, &shared->NullBufferObj, NULL);
 #endif
 
-#if FEATURE_ARB_sync
    {
       struct simple_node *node;
       struct simple_node *temp;
@@ -346,7 +341,6 @@ free_shared_state(GLcontext *ctx, struct gl_shared_state *shared)
 	 _mesa_unref_sync_object(ctx, (struct gl_sync_object *) node);
       }
    }
-#endif
 
    /*
     * Free texture objects (after FBOs since some textures might have
diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c
index 1bff308..ac948cc 100644
--- a/src/mesa/main/syncobj.c
+++ b/src/mesa/main/syncobj.c
@@ -59,6 +59,8 @@
 #include "imports.h"
 #include "context.h"
 #include "macros.h"
+#include "get.h"
+#include "dispatch.h"
 
 #if FEATURE_ARB_sync
 #include "syncobj.h"
@@ -136,6 +138,19 @@ _mesa_init_sync_object_functions(struct dd_function_table *driver)
 }
 
 
+void
+_mesa_init_sync_dispatch(struct _glapi_table *disp)
+{
+   SET_IsSync(disp, _mesa_IsSync);
+   SET_DeleteSync(disp, _mesa_DeleteSync);
+   SET_FenceSync(disp, _mesa_FenceSync);
+   SET_ClientWaitSync(disp, _mesa_ClientWaitSync);
+   SET_WaitSync(disp, _mesa_WaitSync);
+   SET_GetInteger64v(disp, _mesa_GetInteger64v);
+   SET_GetSynciv(disp, _mesa_GetSynciv);
+}
+
+
 /**
  * Allocate/init the context state related to sync objects.
  */
diff --git a/src/mesa/main/syncobj.h b/src/mesa/main/syncobj.h
index c535119..82e141d 100644
--- a/src/mesa/main/syncobj.h
+++ b/src/mesa/main/syncobj.h
@@ -31,15 +31,19 @@
 #ifndef SYNCOBJ_H
 #define SYNCOBJ_H
 
-#include "glheader.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
 
 struct dd_function_table;
 
+#if FEATURE_ARB_sync
+
 extern void
 _mesa_init_sync_object_functions(struct dd_function_table *driver);
 
 extern void
+_mesa_init_sync_dispatch(struct _glapi_table *disp);
+
+extern void
 _mesa_init_sync(GLcontext *);
 
 extern void
@@ -70,4 +74,42 @@ extern void GLAPIENTRY
 _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
 		GLint *values);
 
+#else /* FEATURE_ARB_sync */
+
+#include "main/compiler.h"
+
+static INLINE void
+_mesa_init_sync_object_functions(struct dd_function_table *driver)
+{
+}
+
+static INLINE void
+_mesa_init_sync_dispatch(struct _glapi_table *disp)
+{
+}
+
+static INLINE void
+_mesa_init_sync(GLcontext *ctx)
+{
+}
+
+static INLINE void
+_mesa_free_sync_data(GLcontext *ctx)
+{
+}
+
+static INLINE void
+_mesa_ref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj)
+{
+   ASSERT_NO_FEATURE();
+}
+
+static INLINE void
+_mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj)
+{
+   ASSERT_NO_FEATURE();
+}
+
+#endif /* FEATURE_ARB_sync */
+
 #endif /* SYNCOBJ_H */




More information about the mesa-commit mailing list