}
}
-static void brwInitDriverFunctions( struct dd_function_table *functions )
+static void brwInitDriverFunctions(struct intel_screen *screen,
+ struct dd_function_table *functions)
{
intelInitDriverFunctions( functions );
functions->PrepareExecBegin = brwPrepareExecBegin;
functions->BeginTransformFeedback = brw_begin_transform_feedback;
- functions->EndTransformFeedback = brw_end_transform_feedback;
+
+ if (screen->gen >= 7)
+ functions->EndTransformFeedback = gen7_end_transform_feedback;
+ else
+ functions->EndTransformFeedback = brw_end_transform_feedback;
}
bool
__DRIcontext *driContextPriv,
void *sharedContextPrivate)
{
+ __DRIscreen *sPriv = driContextPriv->driScreenPriv;
+ struct intel_screen *screen = sPriv->driverPrivate;
struct dd_function_table functions;
struct brw_context *brw = rzalloc(NULL, struct brw_context);
struct intel_context *intel = &brw->intel;
return false;
}
- brwInitDriverFunctions( &functions );
+ brwInitDriverFunctions(screen, &functions);
if (!intelInitContext( intel, api, mesaVis, driContextPriv,
sharedContextPrivate, &functions )) {
brw_end_transform_feedback(struct gl_context *ctx,
struct gl_transform_feedback_object *obj);
+/* gen7_sol_state.c */
+void
+gen7_end_transform_feedback(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj);
+
/*======================================================================
},
.emit = upload_sol_state,
};
+
+void
+gen7_end_transform_feedback(struct gl_context *ctx,
+ struct gl_transform_feedback_object *obj)
+{
+ /* Because we have to rely on the kernel to reset our SO write offsets, and
+ * we only get to do it once per batchbuffer, flush the batch after feedback
+ * so another transform feedback can get the write offset reset it needs.
+ *
+ * This also covers any cache flushing required.
+ */
+ struct brw_context *brw = brw_context(ctx);
+ struct intel_context *intel = &brw->intel;
+
+ intel_batchbuffer_flush(intel);
+}