[Piglit] [PATCH] GL_ARB_draw_instanced/dlist: Fix crash

arthur.huillet at free.fr arthur.huillet at free.fr
Tue Dec 6 17:10:53 UTC 2016


From: Arthur Huillet <ahuillet at nvidia.com>

The test was passing a NULL indices pointer without an element buffer bound. Nothing in the GL spec requires a NULL check, so drivers were free to crash before checking the error condition that the test attempts to check. Fix this by passing an index buffer.

Also swap vertex counts and instance counts, which I suspect were mixed up in the test author's head. That part is strictly cosmetic and has no functional impact.

Signed-off-by: Arthur Huillet <ahuillet at nvidia.com>
---
 tests/spec/arb_draw_instanced/execution/dlist.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_draw_instanced/execution/dlist.c b/tests/spec/arb_draw_instanced/execution/dlist.c
index a4c1f1d..8705bfd 100644
--- a/tests/spec/arb_draw_instanced/execution/dlist.c
+++ b/tests/spec/arb_draw_instanced/execution/dlist.c
@@ -61,11 +61,12 @@ piglit_init(int argc, char **argv)
 	list = glGenLists(1);
 	glNewList(list, GL_COMPILE);
 
-	glDrawArraysInstancedARB(GL_TRIANGLES, 0, 2, 3);
+	glDrawArraysInstancedARB(GL_TRIANGLES, 0, 3, 2);
 	if (!piglit_check_gl_error(GL_INVALID_OPERATION))
 		pass = false;
 
-	glDrawElementsInstancedARB(GL_TRIANGLES, 2, GL_UNSIGNED_INT, NULL, 3);
+	unsigned int dummy_buf[] = { 0, 0, 0 };
+	glDrawElementsInstancedARB(GL_TRIANGLES, 3, GL_UNSIGNED_INT, dummy_buf, 2);
 	if (!piglit_check_gl_error(GL_INVALID_OPERATION))
 		pass = false;
 
-- 
2.10.2



More information about the Piglit mailing list