}
}
-/* May fail if out of video memory for texture or vbo upload, or on
- * fallback conditions.
- */
static void
-brw_try_draw_prims(struct gl_context *ctx,
- const struct gl_vertex_array *arrays[],
- const struct _mesa_prim *prims,
- GLuint nr_prims,
- const struct _mesa_index_buffer *ib,
- bool index_bounds_valid,
- GLuint min_index,
- GLuint max_index,
- struct brw_transform_feedback_object *xfb_obj,
- unsigned stream,
- struct gl_buffer_object *indirect)
+brw_prepare_drawing(struct gl_context *ctx,
+ const struct gl_vertex_array *arrays[],
+ const struct _mesa_index_buffer *ib,
+ bool index_bounds_valid,
+ GLuint min_index,
+ GLuint max_index)
{
struct brw_context *brw = brw_context(ctx);
- const struct gen_device_info *devinfo = &brw->screen->devinfo;
- GLuint i;
- bool fail_next = false;
if (ctx->NewState)
_mesa_update_state(ctx);
brw->vb.min_index = min_index;
brw->vb.max_index = max_index;
brw->ctx.NewDriverState |= BRW_NEW_VERTICES;
+}
+
+/* May fail if out of video memory for texture or vbo upload, or on
+ * fallback conditions.
+ */
+static void
+brw_try_draw_prims(struct gl_context *ctx,
+ const struct gl_vertex_array *arrays[],
+ const struct _mesa_prim *prims,
+ GLuint nr_prims,
+ struct brw_transform_feedback_object *xfb_obj,
+ unsigned stream,
+ struct gl_buffer_object *indirect)
+{
+ struct brw_context *brw = brw_context(ctx);
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
+ GLuint i;
+ bool fail_next = false;
for (i = 0; i < nr_prims; i++) {
/* Flag BRW_NEW_DRAW_CALL on every draw. This allows us to have
index_bounds_valid = true;
}
+ brw_prepare_drawing(ctx, arrays, ib, index_bounds_valid, min_index,
+ max_index);
/* Try drawing with the hardware, but don't do anything else if we can't
* manage it. swrast doesn't support our featureset, so we can't fall back
* to it.
*/
- brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, index_bounds_valid,
- min_index, max_index, xfb_obj, stream, indirect);
+ brw_try_draw_prims(ctx, arrays, prims, nr_prims, xfb_obj, stream, indirect);
}
void