diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2015-02-11 13:40:20 -0800 |
---|---|---|
committer | Ben Widawsky <benjamin.widawsky@intel.com> | 2015-02-17 16:17:04 -0800 |
commit | 7db7ea9d548ae15c41def255acf40fefc02ae394 (patch) | |
tree | 43a8e933cf7df108272324c1d30fb657a542dacd /tests | |
parent | 6104ffefcedb53d6bdbd1be8e0a98f94112d38f2 (diff) |
ARB_pipeline_statistics_query: Add range for expected results
Ben: rebased for 64bit data types
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tests')
3 files changed, 12 insertions, 7 deletions
diff --git a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c index 7072b4eaa..969b76b6a 100644 --- a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c +++ b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c @@ -81,15 +81,15 @@ static struct query queries[] = { { .query = GL_PRIMITIVES_SUBMITTED_ARB, .name = "GL_PRIMITIVES_SUBMITTED_ARB", - .expected = NUM_PRIMS}, + .min = NUM_PRIMS}, { .query = GL_VERTICES_SUBMITTED_ARB, .name = "GL_VERTICES_SUBMITTED_ARB", - .expected = NUM_VERTS}, + .min = NUM_VERTS}, { .query = GL_VERTEX_SHADER_INVOCATIONS_ARB, .name = "GL_VERTEX_SHADER_INVOCATIONS_ARB", - .expected = NUM_VERTS} + .min = NUM_VERTS} }; /* Use DISPLAY for debug */ diff --git a/tests/spec/arb_pipeline_statistics_query/pipestat_help.c b/tests/spec/arb_pipeline_statistics_query/pipestat_help.c index 09168044d..9f2d43d60 100644 --- a/tests/spec/arb_pipeline_statistics_query/pipestat_help.c +++ b/tests/spec/arb_pipeline_statistics_query/pipestat_help.c @@ -77,11 +77,15 @@ do_query(const struct query *queries, const int count) end_query(&queries[i]); for (i = 0; i < count; i++) { + const struct query *q = &queries[i]; + GLuint64 max = q->max != 0 ? q->max : q->min; GLuint64 params; + glGetQueryObjectui64v(queries[i].obj, GL_QUERY_RESULT, ¶ms); - if (params != queries[i].expected) { - fprintf(stderr, "%s was %" PRIu64 "Expected %" PRIu64 "\n", - queries[i].name, params, queries[i].expected); + if (q->min > params || max < params) { + fprintf(stderr, + "%s value was invalid.\n Expected: %" PRIu64 " - %" PRIu64 "\n Observed: %" PRIu64 "\n", + q->name, q->min, max, params); piglit_report_result(PIGLIT_FAIL); } } diff --git a/tests/spec/arb_pipeline_statistics_query/pipestat_help.h b/tests/spec/arb_pipeline_statistics_query/pipestat_help.h index 97cb3ca2d..ac5d13ccc 100644 --- a/tests/spec/arb_pipeline_statistics_query/pipestat_help.h +++ b/tests/spec/arb_pipeline_statistics_query/pipestat_help.h @@ -10,7 +10,8 @@ struct query { GLuint obj; GLuint query; const char *name; - GLuint64 expected; + GLuint64 min; + GLuint64 max; }; static inline void |