void
_mesa_init_transform_feedback(GLcontext *ctx)
{
- if (!ctx->Driver.NewTransformFeedback) {
- /* this feature/extension may not be supported by the driver */
- return;
- }
+ /* core mesa expects this, even a dummy one, to be available */
+ ASSERT(ctx->Driver.NewTransformFeedback);
ctx->TransformFeedback.DefaultObject =
ctx->Driver.NewTransformFeedback(ctx, 0);
void
_mesa_free_transform_feedback(GLcontext *ctx)
{
- if (!ctx->Driver.NewTransformFeedback) {
- /* this feature/extension may not be supported by the driver */
- return;
- }
+ /* core mesa expects this, even a dummy one, to be available */
+ ASSERT(ctx->Driver.NewTransformFeedback);
_mesa_reference_buffer_object(ctx,
&ctx->TransformFeedback.CurrentBuffer,
}
+#else /* FEATURE_EXT_transform_feedback */
+
+/* forward declarations */
+static struct gl_transform_feedback_object *
+new_transform_feedback(GLcontext *ctx, GLuint name);
+
+static void
+delete_transform_feedback(GLcontext *ctx,
+ struct gl_transform_feedback_object *obj);
+
+/* dummy per-context init/clean-up for transform feedback */
+void
+_mesa_init_transform_feedback(GLcontext *ctx)
+{
+ ctx->TransformFeedback.DefaultObject = new_transform_feedback(ctx, 0);
+ ctx->TransformFeedback.CurrentObject = ctx->TransformFeedback.DefaultObject;
+ _mesa_reference_buffer_object(ctx,
+ &ctx->TransformFeedback.CurrentBuffer,
+ ctx->Shared->NullBufferObj);
+}
+
+void
+_mesa_free_transform_feedback(GLcontext *ctx)
+{
+ _mesa_reference_buffer_object(ctx,
+ &ctx->TransformFeedback.CurrentBuffer,
+ NULL);
+ ctx->TransformFeedback.CurrentObject = NULL;
+ delete_transform_feedback(ctx, ctx->TransformFeedback.DefaultObject);
+}
+
+#endif /* FEATURE_EXT_transform_feedback */
+
+
/** Default fallback for ctx->Driver.NewTransformFeedback() */
static struct gl_transform_feedback_object *
new_transform_feedback(GLcontext *ctx, GLuint name)
free(obj);
}
+
+#if FEATURE_EXT_transform_feedback
+
+
/** Default fallback for ctx->Driver.BeginTransformFeedback() */
static void
begin_transform_feedback(GLcontext *ctx, GLenum mode,
#include "main/mtypes.h"
+extern void
+_mesa_init_transform_feedback(GLcontext *ctx);
+
+extern void
+_mesa_free_transform_feedback(GLcontext *ctx);
+
#if FEATURE_EXT_transform_feedback
extern GLboolean
extern GLboolean
_mesa_validate_transform_feedback_buffers(GLcontext *ctx);
-extern void
-_mesa_init_transform_feedback(GLcontext *ctx);
-
-extern void
-_mesa_free_transform_feedback(GLcontext *ctx);
-
extern void
_mesa_init_transform_feedback_functions(struct dd_function_table *driver);
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)
{