[Piglit] [PATCH 2/6] shader_runner: add "draw instanced rect ortho" commands
Marek Olšák
maraeo at gmail.com
Sun Apr 30 14:58:35 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
---
tests/shaders/shader_runner.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
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);
--
2.7.4
More information about the Piglit
mailing list