diff options
author | Illia Iorin <illia.iorin@globallogic.com> | 2019-03-12 15:25:17 +0200 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2019-03-19 09:13:58 -0700 |
commit | c3af09e1b3495d9b5158f83fa64385d5ef3c0e08 (patch) | |
tree | 97056db82d456dfb431fca1771551b712754cd0a | |
parent | 9419df68416676363fa237c67195eb6d1db9b61f (diff) |
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: Illia Iorin <illia.iorin@globallogic.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | tests/spec/arb_query_buffer_object/coherency.c | 8 | ||||
-rw-r--r-- | tests/spec/arb_shader_atomic_counters/array-indexing.c | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/spec/arb_query_buffer_object/coherency.c b/tests/spec/arb_query_buffer_object/coherency.c index 834daba0d..3f59fbe46 100644 --- a/tests/spec/arb_query_buffer_object/coherency.c +++ b/tests/spec/arb_query_buffer_object/coherency.c @@ -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]; diff --git a/tests/spec/arb_shader_atomic_counters/array-indexing.c b/tests/spec/arb_shader_atomic_counters/array-indexing.c index e1a816dee..8edb73718 100644 --- a/tests/spec/arb_shader_atomic_counters/array-indexing.c +++ b/tests/spec/arb_shader_atomic_counters/array-indexing.c @@ -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); |