The comment was incorrect: we can have N draws using the
same mode with N > 1 (eg: GL_QUAD_STRIP draws
cannot be merged).
This commit fixes the drawing code to use the correct draw
function.
This fixes a hang in Starsector (see issue #5086).
Fixes:
b328d8e9bc9 ("dlist: use an union instead of allocating a 1-sized array")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11978>
node->merged.start_counts,
node->merged.mode,
node->merged.num_draws);
- } else if (node->merged.num_draws) {
- /* If node->merged.mode is NULL then num_draws is 0 or 1 */
+ } else if (node->merged.num_draws == 1) {
ctx->Driver.DrawGallium(ctx, info, 0, &node->merged.start_count, 1);
+ } else if (node->merged.num_draws) {
+ ctx->Driver.DrawGallium(ctx, info, 0, node->merged.start_counts,
+ node->merged.num_draws);
}
info->index.gl_bo = gl_bo;