return false;
}
+#define DRAW_CLEANUP do { \
+ if (index_size && indexbuf != info->index.resource) \
+ pipe_resource_reference(&indexbuf, NULL); \
+ } while (0)
+
static void si_draw_vbo(struct pipe_context *ctx,
const struct pipe_draw_info *info,
const struct pipe_draw_indirect_info *indirect,
break;
case SI_PRIM_DISCARD_DRAW_SPLIT:
sctx->compute_num_verts_rejected -= total_direct_count;
- goto return_cleanup;
+ FALLTHROUGH;
case SI_PRIM_DISCARD_MULTI_DRAW_SPLIT:
- goto return_cleanup;
+ /* The multi draw was split into multiple ones and executed. Return. */
+ DRAW_CLEANUP;
+ return;
}
}
}
if (unlikely(sctx->do_update_shaders)) {
- if (unlikely(!si_update_shaders(sctx)))
- goto return_cleanup;
+ if (unlikely(!si_update_shaders(sctx))) {
+ DRAW_CLEANUP;
+ return;
+ }
/* Insert a VGT_FLUSH when enabling fast launch changes to prevent hangs.
* See issues #2418, #2426, #2434
if (unlikely(!si_upload_graphics_shader_descriptors(sctx) ||
(sctx->vertex_buffers_dirty &&
sctx->num_vertex_elements &&
- !si_upload_vertex_buffer_descriptors(sctx))))
- goto return_cleanup;
+ !si_upload_vertex_buffer_descriptors(sctx)))) {
+ DRAW_CLEANUP;
+ return;
+ }
/* Vega10/Raven scissor bug workaround. When any context register is
* written (i.e. the GPU rolls the context), PA_SC_VPORT_SCISSOR
sctx->num_spill_draw_calls++;
}
-return_cleanup:
- if (index_size && indexbuf != info->index.resource)
- pipe_resource_reference(&indexbuf, NULL);
+ DRAW_CLEANUP;
}
static void si_draw_rectangle(struct blitter_context *blitter, void *vertex_elements_cso,