diff options
author | Chia-I Wu <[email protected]> | 2010-05-11 13:20:40 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-05-12 12:12:56 +0800 |
commit | b093016bd0660cc4ac6142aa8d4d6add5b6bfce8 (patch) | |
tree | 75b37b0c29ea2ae746542a979314d31027096bb5 /src/mesa/main | |
parent | 903986ca128d51ff031cc9eafa1976618834a8de (diff) |
mesa: Make FEATURE_EXT_transform_feedback more modular.
This allows transformfeedback.h and st_cb_xformfb.h to be included and
used without knowing if FEATURE_EXT_transform_feedback is enabled. Fix
build of ES overlay.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/api_exec.c | 10 | ||||
-rw-r--r-- | src/mesa/main/transformfeedback.c | 19 | ||||
-rw-r--r-- | src/mesa/main/transformfeedback.h | 42 |
3 files changed, 61 insertions, 10 deletions
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index f838561aef3..8fa8887a6c9 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -523,15 +523,7 @@ _mesa_create_exec_table(void) SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT); /* 352. GL_EXT_transform_feedback */ -#if _HAVE_FULL_GL - SET_BeginTransformFeedbackEXT(exec, _mesa_BeginTransformFeedback); - SET_EndTransformFeedbackEXT(exec, _mesa_EndTransformFeedback); - SET_BindBufferRangeEXT(exec, _mesa_BindBufferRange); - SET_BindBufferBaseEXT(exec, _mesa_BindBufferBase); - SET_BindBufferOffsetEXT(exec, _mesa_BindBufferOffsetEXT); - SET_TransformFeedbackVaryingsEXT(exec, _mesa_TransformFeedbackVaryings); - SET_GetTransformFeedbackVaryingEXT(exec, _mesa_GetTransformFeedbackVarying); -#endif + _mesa_init_transform_feedback_dispatch(exec); /* 364. GL_EXT_provoking_vertex */ SET_ProvokingVertexEXT(exec, _mesa_ProvokingVertexEXT); diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 06a12814e2d..cd3dd9b38c1 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -35,11 +35,15 @@ #include "context.h" #include "hash.h" #include "transformfeedback.h" +#include "main/dispatch.h" #include "shader/prog_parameter.h" #include "shader/shader_api.h" +#if FEATURE_EXT_transform_feedback + + /** * Do reference counting of transform feedback buffers. */ @@ -281,6 +285,18 @@ _mesa_init_transform_feedback_functions(struct dd_function_table *driver) } +void +_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp) +{ + SET_BeginTransformFeedbackEXT(disp, _mesa_BeginTransformFeedback); + SET_EndTransformFeedbackEXT(disp, _mesa_EndTransformFeedback); + SET_BindBufferRangeEXT(disp, _mesa_BindBufferRange); + SET_BindBufferBaseEXT(disp, _mesa_BindBufferBase); + SET_BindBufferOffsetEXT(disp, _mesa_BindBufferOffsetEXT); + SET_TransformFeedbackVaryingsEXT(disp, _mesa_TransformFeedbackVaryings); + SET_GetTransformFeedbackVaryingEXT(disp, _mesa_GetTransformFeedbackVarying); +} + /** ** Begin API functions @@ -879,3 +895,6 @@ GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE GL_TRANSFORM_FEEDBACK_BINDING */ + + +#endif /* FEATURE_EXT_transform_feedback */ diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h index 99f75ee4357..b806488abdd 100644 --- a/src/mesa/main/transformfeedback.h +++ b/src/mesa/main/transformfeedback.h @@ -25,9 +25,11 @@ #ifndef TRANSFORM_FEEDBACK_H #define TRANSFORM_FEEDBACK_H -#include "glheader.h" +#include "main/mtypes.h" +#if FEATURE_EXT_transform_feedback + extern GLboolean _mesa_validate_primitive_mode(GLcontext *ctx, GLenum mode); @@ -44,6 +46,9 @@ _mesa_free_transform_feedback(GLcontext *ctx); extern void _mesa_init_transform_feedback_functions(struct dd_function_table *driver); +extern void +_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp); + /*** GL_EXT_transform_feedback ***/ @@ -98,5 +103,40 @@ _mesa_ResumeTransformFeedback(void); extern void GLAPIENTRY _mesa_DrawTransformFeedback(GLenum mode, GLuint name); +#else /* FEATURE_EXT_transform_feedback */ + +static INLINE GLboolean +_mesa_validate_primitive_mode(GLcontext *ctx, GLenum mode) +{ + return GL_TRUE; +} + +static INLINE GLboolean +_mesa_validate_transform_feedback_buffers(GLcontext *ctx) +{ + return GL_TRUE; +} + +static INLINE void +_mesa_init_transform_feedback(GLcontext *ctx) +{ +} + +static INLINE void +_mesa_free_transform_feedback(GLcontext *ctx) +{ +} + +static INLINE void +_mesa_init_transform_feedback_functions(struct dd_function_table *driver) +{ +} + +static INLINE void +_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_EXT_transform_feedback */ #endif /* TRANSFORM_FEEDBACK_H */ |