summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-09-13 13:35:12 +0800
committerChia-I Wu <olv@lunarg.com>2010-09-14 15:49:47 +0800
commit10ff2646a443ca3c54d66443b346eb7063973b5e (patch)
treef2836e3ab2e033c6c07e4d5903a3d2f75cba61e1 /src
parentdb6273e0ddc5dbfcff27b8f75982bbf348810d31 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/api_exec.c12
-rw-r--r--src/mesa/main/context.c6
-rw-r--r--src/mesa/main/shared.c6
-rw-r--r--src/mesa/main/syncobj.c15
-rw-r--r--src/mesa/main/syncobj.h46
5 files changed, 60 insertions, 25 deletions
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 82e1f0fdba..c3c710f5ef 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 979bc4019b..b1f800f4c2 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 ea7e503cf3..a56c70fa7f 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 1bff308177..ac948cc1ef 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 c53511995b..82e141d408 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 */