[Mesa-dev] [PATCH] i965/batch: don't ignore the 'brw_new_batch' call for a 'new batch'

Chris Wilson chris at chris-wilson.co.uk
Mon Sep 10 11:44:49 UTC 2018


Quoting andrey simiklit (2018-08-21 13:00:57)
> Hi all,
> 
> The bug for this issue was created:
> https://bugs.freedesktop.org/show_bug.cgi?id=107626

What about something like

diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 8536c040109..babb8d4676d 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -885,7 +885,7 @@ brw_draw_single_prim(struct gl_context *ctx,
 {
    struct brw_context *brw = brw_context(ctx);
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
-   bool fail_next = false;
+   bool fail_next;
 
    /* Flag BRW_NEW_DRAW_CALL on every draw.  This allows us to have
     * atoms that happen on every draw call.
@@ -898,6 +898,7 @@ brw_draw_single_prim(struct gl_context *ctx,
    intel_batchbuffer_require_space(brw, 1500);
    brw_require_statebuffer_space(brw, 2400);
    intel_batchbuffer_save_state(brw);
+   fail_next = brw->batch.saved.map_next == 0;
 
    if (brw->num_instances != prim->num_instances ||
        brw->basevertex != prim->basevertex ||

There's no point reverting to the last saved point if that save point is
the empty batch, we will just repeat ourselves.
-Chris


More information about the mesa-dev mailing list