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.
This commit is contained in:
Chia-I Wu
2010-09-13 13:35:12 +08:00
parent db6273e0dd
commit 10ff2646a4
5 changed files with 60 additions and 25 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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

View File

@@ -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.
*/

View File

@@ -31,14 +31,18 @@
#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 *);
@@ -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 */