aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen6_sol.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-05-24 01:29:14 -0700
committerKenneth Graunke <[email protected]>2013-10-31 11:04:37 -0700
commit0d7033c3940aa6aef7ab72dc31ab154b2e614b1b (patch)
tree01be4f5fc2dc6e31795e9b2e158f819946383064 /src/mesa/drivers/dri/i965/gen6_sol.c
parentbe6227d29dcf443d9b8bae66d3d2f0b946874a83 (diff)
i965: Create a new brw_transform_feedback_object subclass.
This adds the basic driver hooks to allocate/free the brw variant. It doesn't contain any additional information yet, but it will soon. v2: Use the new _mesa_init_transform_feedback_object helper function (requested by Eric and Ian). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_sol.c')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_sol.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_sol.c b/src/mesa/drivers/dri/i965/gen6_sol.c
index 9a3feb52e71..484be42b390 100644
--- a/src/mesa/drivers/dri/i965/gen6_sol.c
+++ b/src/mesa/drivers/dri/i965/gen6_sol.c
@@ -26,6 +26,7 @@
* Code to initialize the binding table entries used by transform feedback.
*/
+#include "main/bufferobj.h"
#include "main/macros.h"
#include "brw_context.h"
#include "intel_batchbuffer.h"
@@ -132,6 +133,34 @@ const struct brw_tracked_state gen6_gs_binding_table = {
.emit = brw_gs_upload_binding_table,
};
+struct gl_transform_feedback_object *
+brw_new_transform_feedback(struct gl_context *ctx, GLuint name)
+{
+ struct brw_context *brw = brw_context(ctx);
+ struct brw_transform_feedback_object *brw_obj =
+ CALLOC_STRUCT(brw_transform_feedback_object);
+ if (!brw_obj)
+ return NULL;
+
+ _mesa_init_transform_feedback_object(&brw_obj->base, name);
+
+ return &brw_obj->base;
+}
+
+void
+brw_delete_transform_feedback(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj)
+{
+ struct brw_transform_feedback_object *brw_obj =
+ (struct brw_transform_feedback_object *) obj;
+
+ for (unsigned i = 0; i < Elements(obj->Buffers); i++) {
+ _mesa_reference_buffer_object(ctx, &obj->Buffers[i], NULL);
+ }
+
+ free(brw_obj);
+}
+
void
brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
struct gl_transform_feedback_object *obj)