[33/63] shader_runner: Add a “draw arrays instanced base” command

Submitted by apinheiro on Feb. 23, 2019, 11:45 p.m.

Details

Message ID 20190223234551.21111-34-apinheiro@igalia.com
State New
Headers show
Series "ARB_gl_spirv full series" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

apinheiro Feb. 23, 2019, 11:45 p.m.
From: Neil Roberts <nroberts@igalia.com>

This is just like “draw arrays instanced” but has an extra parameter
to set the baseinstance.
---
 tests/shaders/shader_runner.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 778229e2a..c53980b20 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -4855,6 +4855,16 @@  piglit_display(void)
 			size_t primcount = (size_t) z;
 			draw_arrays_common(first, count);
 			glDrawArraysInstanced(mode, first, count, primcount);
+		} else if (sscanf(line, "draw arrays instanced base %31s %d %d %d %d", s, &x, &y, &z, &w) == 5) {
+			GLenum mode = decode_drawing_mode(s);
+			int first = x;
+			size_t count = (size_t) y;
+			size_t primcount = (size_t) z;
+			GLuint baseinstance = (GLuint) w;
+			draw_arrays_common(first, count);
+			glDrawArraysInstancedBaseInstance(mode, first, count,
+							  primcount,
+							  baseinstance);
 		} else if (sscanf(line, "draw arrays %31s %d %d", s, &x, &y) == 3) {
 			GLenum mode = decode_drawing_mode(s);
 			int first = x;