í965: don't use _mesa_prim::is_indirect
authorMarek Olšák <marek.olsak@amd.com>
Tue, 4 Feb 2020 01:34:06 +0000 (20:34 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 11 Feb 2020 00:34:57 +0000 (00:34 +0000)
the vbo change only affects i965

Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3766>

src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/vbo/vbo_primitive_restart.c

index a4d3ab1294f3beb3ddc99694d0559ee62ccab8bb..3f705bce6ac034bf78acc068d2fb84c826b69887 100644 (file)
@@ -160,7 +160,8 @@ brw_emit_prim(struct brw_context *brw,
               const struct _mesa_prim *prim,
               uint32_t hw_prim,
               struct brw_transform_feedback_object *xfb_obj,
-              unsigned stream)
+              unsigned stream,
+              bool is_indirect)
 {
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
    int verts_per_instance;
@@ -193,7 +194,7 @@ brw_emit_prim(struct brw_context *brw,
       verts_per_instance = prim->count;
 
    /* If nothing to emit, just return. */
-   if (verts_per_instance == 0 && !prim->is_indirect && !xfb_obj)
+   if (verts_per_instance == 0 && !is_indirect && !xfb_obj)
       return;
 
    /* If we're set to always flush, do it before and after the primitive emit.
@@ -222,7 +223,7 @@ brw_emit_prim(struct brw_context *brw,
       OUT_BATCH(GEN7_3DPRIM_START_INSTANCE);
       OUT_BATCH(0);
       ADVANCE_BATCH();
-   } else if (prim->is_indirect) {
+   } else if (is_indirect) {
       struct gl_buffer_object *indirect_buffer = brw->ctx.DrawIndirectBuffer;
       struct brw_bo *bo = intel_bufferobj_buffer(brw,
             intel_buffer_object(indirect_buffer),
@@ -1002,7 +1003,7 @@ brw_draw_single_prim(struct gl_context *ctx,
          vs_prog_data->uses_firstvertex ||
          vs_prog_data->uses_baseinstance;
 
-      if ((uses_draw_parameters && prim->is_indirect) ||
+      if ((uses_draw_parameters && indirect) ||
           (vs_prog_data->uses_firstvertex &&
            brw->draw.params.firstvertex != new_firstvertex) ||
           (vs_prog_data->uses_baseinstance &&
@@ -1014,7 +1015,7 @@ brw_draw_single_prim(struct gl_context *ctx,
    brw->draw.params.gl_baseinstance = new_baseinstance;
    brw_bo_unreference(brw->draw.draw_params_bo);
 
-   if (prim->is_indirect) {
+   if (indirect) {
       /* Point draw_params_bo at the indirect buffer. */
       brw->draw.draw_params_bo =
          intel_buffer_object(ctx->DrawIndirectBuffer)->buffer;
@@ -1065,7 +1066,7 @@ retry:
    if (devinfo->gen == 9)
       gen9_emit_preempt_wa(brw, prim);
 
-   brw_emit_prim(brw, prim, brw->primitive, xfb_obj, stream);
+   brw_emit_prim(brw, prim, brw->primitive, xfb_obj, stream, !!indirect);
 
    brw->batch.no_wrap = false;
 
@@ -1219,7 +1220,6 @@ brw_draw_indirect_prims(struct gl_context *ctx,
       prim[i].mode = mode;
       prim[i].indexed = ib != NULL;
       prim[i].indirect_offset = indirect_offset;
-      prim[i].is_indirect = 1;
       prim[i].draw_id = i;
    }
 
index a3c65f422ba699f4f80834584b8553da3dccb810..8d279fd637a638d9e437bbc7033cf209301e555c 100644 (file)
@@ -181,7 +181,7 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
    void *ptr;
 
    /* If there is an indirect buffer, map it and extract the draw params */
-   if (indirect && prims[0].is_indirect) {
+   if (indirect) {
       const uint32_t *indirect_params;
       if (!ctx->Driver.MapBufferRange(ctx, 0, indirect->Size, GL_MAP_READ_BIT,
                                       indirect, MAP_INTERNAL)) {