dlist: don't handle unmerged draws as merged

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: b328d8e9bc ("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>
(cherry picked from commit 11d6441b94)
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2021-07-20 14:31:19 +02:00 committed by Dylan Baker
parent f27415c223
commit 0eb551f658
2 changed files with 5 additions and 3 deletions

View file

@ -121,7 +121,7 @@
"description": "dlist: don't handle unmerged draws as merged",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "b328d8e9bc9900a0372d7c3307f18ad11d708af9"
},

View file

@ -247,9 +247,11 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data, bool copy_to_c
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;