diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2021-01-05 16:26:42 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2021-01-08 14:51:09 -0800 |
commit | a64a20cead1006d49cb89ad539b2c6f69da6b03e (patch) | |
tree | 78446dfc37e9a6ee53f505060016d448f27edc18 | |
parent | 17ea4f3327cc8b3560e81a936e2b349e3b14d2f6 (diff) |
draw-elements: Add dummy count=0 draws to each glMultiDrawElements call
Passes on i965, but fails on Iris with:
src/gallium/auxiliary/util/u_inlines.h:341:pipe_buffer_map_range: Assertion `length' failed.
Aborted (core dumped)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/444>
-rw-r--r-- | tests/general/draw-elements.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/general/draw-elements.c b/tests/general/draw-elements.c index 12fad47a1..66e0303e4 100644 --- a/tests/general/draw-elements.c +++ b/tests/general/draw-elements.c @@ -104,14 +104,16 @@ static void test_ubyte_indices(float x1, float y1, float x2, float y2, int test) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indx), indx, GL_STATIC_DRAW); if (use_multi) { - GLsizei count[] = {3, 3}; + static const GLsizei count[] = {3, 3, 0}; /* We need 2 draws in order to get non-zero in * pipe_draw_info::start, so make the second draw * a zero-area triangle. */ const void *offset[] = {(void*)(intptr_t)(index*9), + (void*)(intptr_t)1, (void*)(intptr_t)1}; glMultiDrawElements(GL_TRIANGLES, count, - GL_UNSIGNED_BYTE, offset, 2); + GL_UNSIGNED_BYTE, offset, + ARRAY_SIZE(count)); } else { glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_BYTE, (void*)(intptr_t)(index*9)); @@ -120,11 +122,12 @@ static void test_ubyte_indices(float x1, float y1, float x2, float y2, int test) glDeleteBuffers(1, &buf); } else { if (use_multi) { - GLsizei count[] = {3, 3}; + static const GLsizei count[] = {3, 3, 0}; /* The second draw is a zero-area triangle. */ - const void *indices[] = {indx + index*9, indx + 1}; + const void *indices[] = {indx + index*9, indx + 1, indx + 1}; glMultiDrawElements(GL_TRIANGLES, count, - GL_UNSIGNED_BYTE, indices, 2); + GL_UNSIGNED_BYTE, indices, + ARRAY_SIZE(count)); } else { glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_BYTE, indx + index*9); |