mesa: don't unroll glMultiDrawElements if one count is 0

let the driver skip or submit an empty draw call.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
This commit is contained in:
Marek Olšák 2020-02-12 17:21:35 -05:00 committed by Marge Bot
parent 4c5cd113b8
commit e636a062f1

View file

@ -1212,16 +1212,6 @@ _mesa_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
}
}
/* Draw primitives individually if one count is zero, so we can easily skip
* that primitive.
*/
for (i = 0; i < primcount; i++) {
if (count[i] == 0) {
fallback = GL_TRUE;
break;
}
}
/* If the index buffer isn't in a VBO, then treating the application's
* subranges of the index buffer as one large index buffer may lead to
* us reading unmapped memory.