Commit c3af09e1 authored by Illia Iorin's avatar Illia Iorin Committed by Eric Anholt

tests: Check that count of vertex atomic counters enough for test

In OpenGL 4.6 (Table 23.57: Implementation Dependent Vertex Shader Limits)
specification  said, that minimum value of MAX_VERTEX_ATOMIC_COUNTERS is 0.
Therefore if we use them we have to check available count.
Signed-off-by: default avatarIllia Iorin <illia.iorin@globallogic.com>
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
parent 9419df68
......@@ -274,6 +274,7 @@ enum piglit_result
piglit_display(void)
{
enum piglit_result result = PIGLIT_PASS;
int vertex_counters;
unsigned qnum_count = num_query_types();
for (unsigned cnum = 0; cnum < ARRAY_SIZE(consumer_modes); cnum++) {
......@@ -291,6 +292,13 @@ piglit_display(void)
}
}
if (!strcmp(cm->name, "indirect-draw-count")) {
glGetIntegerv(GL_MAX_VERTEX_ATOMIC_COUNTERS, &vertex_counters);
if(vertex_counters < 1)
supported = false;
}
for (unsigned qnum = 0; qnum < qnum_count; qnum++) {
enum piglit_result subtest_result = PIGLIT_SKIP;
const struct query_type_desc *qdesc = &query_types[qnum];
......
......@@ -140,10 +140,20 @@ void
piglit_init(int argc, char **argv)
{
GLuint fb, rb, buffer;
int vertex_counters;
piglit_require_gl_version(31);
piglit_require_extension("GL_ARB_shader_atomic_counters");
glGetIntegerv(GL_MAX_VERTEX_ATOMIC_COUNTERS,
&vertex_counters);
if(vertex_counters < 3) {
fprintf(stderr, "Insufficient number of supported atomic "
"counter buffers.\n");
piglit_report_result(PIGLIT_SKIP);
}
glGenFramebuffers(1, &fb);
glGenRenderbuffers(1, &rb);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment