[2/6] shader_runner: add "draw instanced rect ortho" commands

Submitted by Marek Olšák on April 30, 2017, 2:58 p.m.

Details

Message ID 1493564319-19759-2-git-send-email-maraeo@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Marek Olšák April 30, 2017, 2:58 p.m.
From: Marek Olšák <marek.olsak@amd.com>

---
 tests/shaders/shader_runner.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index b2eeba8..f82332c 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2994,20 +2994,44 @@  piglit_display(void)
 					 2.0 * (c[3] / piglit_height));
 		} else if (parse_str(line, "draw rect patch ", &rest)) {
 			result = program_must_be_in_use();
 			parse_floats(rest, c, 4, NULL);
 			piglit_draw_rect_custom(c[0], c[1], c[2], c[3], true, 1);
 		} else if (parse_str(line, "draw rect ", &rest)) {
 			result = program_must_be_in_use();
 			program_subroutine_uniforms();
 			parse_floats(rest, c, 4, NULL);
 			piglit_draw_rect(c[0], c[1], c[2], c[3]);
+		} else if (parse_str(line, "draw instanced rect ortho patch ", &rest)) {
+			int instance_count;
+
+			result = program_must_be_in_use();
+			sscanf(rest, "%d %f %f %f %f",
+			       &instance_count,
+			       c + 0, c + 1, c + 2, c + 3);
+			piglit_draw_rect_custom(-1.0 + 2.0 * (c[0] / piglit_width),
+						-1.0 + 2.0 * (c[1] / piglit_height),
+						2.0 * (c[2] / piglit_width),
+						2.0 * (c[3] / piglit_height), true,
+						instance_count);
+		} else if (parse_str(line, "draw instanced rect ortho ", &rest)) {
+			int instance_count;
+
+			result = program_must_be_in_use();
+			sscanf(rest, "%d %f %f %f %f",
+			       &instance_count,
+			       c + 0, c + 1, c + 2, c + 3);
+			piglit_draw_rect_custom(-1.0 + 2.0 * (c[0] / piglit_width),
+						-1.0 + 2.0 * (c[1] / piglit_height),
+						2.0 * (c[2] / piglit_width),
+						2.0 * (c[3] / piglit_height), false,
+						instance_count);
 		} else if (parse_str(line, "draw instanced rect ", &rest)) {
 			int primcount;
 
 			result = program_must_be_in_use();
 			sscanf(rest, "%d %f %f %f %f",
 			       &primcount,
 			       c + 0, c + 1, c + 2, c + 3);
 			draw_instanced_rect(primcount, c[0], c[1], c[2], c[3]);
 		} else if (sscanf(line, "draw arrays %31s %d %d", s, &x, &y) == 3) {
 			GLenum mode = decode_drawing_mode(s);