[Piglit] [PATCH 6/7] arb_shader_atomic_counters: set KHR_no_error compatibility

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue May 23 21:48:22 UTC 2017


Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 05/18/2017 04:00 AM, Timothy Arceri wrote:
> ---
>   .../arb_shader_atomic_counters/active-counters.c   | 29 +++++++++++++---------
>   .../arb_shader_atomic_counters/array-indexing.c    |  1 +
>   .../arb_shader_atomic_counters/buffer-binding.c    | 13 ++++++----
>   .../arb_shader_atomic_counters/default-partition.c |  1 +
>   .../arb_shader_atomic_counters/fragment-discard.c  |  1 +
>   .../arb_shader_atomic_counters/function-argument.c |  1 +
>   .../spec/arb_shader_atomic_counters/max-counters.c |  1 +
>   tests/spec/arb_shader_atomic_counters/minmax.c     |  1 +
>   .../arb_shader_atomic_counters/multiple-defs.c     |  1 +
>   .../arb_shader_atomic_counters/respecify-buffer.c  |  1 +
>   tests/spec/arb_shader_atomic_counters/semantics.c  |  1 +
>   tests/spec/arb_shader_atomic_counters/unique-id.c  |  1 +
>   .../arb_shader_atomic_counters/unused-result.c     |  1 +
>   13 files changed, 36 insertions(+), 17 deletions(-)
> 
> diff --git a/tests/spec/arb_shader_atomic_counters/active-counters.c b/tests/spec/arb_shader_atomic_counters/active-counters.c
> index 06ba2e7..976b858 100644
> --- a/tests/spec/arb_shader_atomic_counters/active-counters.c
> +++ b/tests/spec/arb_shader_atomic_counters/active-counters.c
> @@ -30,20 +30,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   const char *fs_source = "#version 140\n"
>           "#extension GL_ARB_shader_atomic_counters : enable\n"
>           "\n"
>           "out ivec4 fcolor;\n"
>           "\n"
>           "layout(binding=0) uniform atomic_uint x0[2];\n"
>           "layout(binding=0) uniform atomic_uint x1;\n"
> @@ -155,34 +156,38 @@ piglit_init(int argc, char **argv)
>                   piglit_report_result(PIGLIT_FAIL);
>           }
>   
>           glGetProgramiv(prog, GL_ACTIVE_ATOMIC_COUNTER_BUFFERS, &n);
>           if (n != 4) {
>                   fprintf(stderr, "Unexpected number of active counter "
>                           "buffers.\n");
>                   piglit_report_result(PIGLIT_FAIL);
>           }
>   
> -        ret = 0xdeadbeef;
> -        glGetActiveAtomicCounterBufferiv(
> -                prog, n, GL_ATOMIC_COUNTER_BUFFER_BINDING, &ret);
> +        if (!piglit_khr_no_error) {
> +                ret = 0xdeadbeef;
> +                glGetActiveAtomicCounterBufferiv(
> +                        prog, n, GL_ATOMIC_COUNTER_BUFFER_BINDING, &ret);
>   
> -        if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
> -                fprintf(stderr, "glGetActiveAtomicCounterBufferiv should have "
> -                        "failed when trying to query a non-existent buffer.\n");
> -                piglit_report_result(PIGLIT_FAIL);
> -        }
> +                if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
> +                        fprintf(stderr, "glGetActiveAtomicCounterBufferiv "
> +                                "should have failed when trying to query a "
> +                                "non-existent buffer.\n");
> +                        piglit_report_result(PIGLIT_FAIL);
> +                }
>   
> -        if (ret != 0xdeadbeef) {
> -                fprintf(stderr, "Failed call to glGetActiveAtomicCounterBufferiv"
> -                        "didn't preserve the output parameter contents.\n");
> -                piglit_report_result(PIGLIT_FAIL);
> +                if (ret != 0xdeadbeef) {
> +                        fprintf(stderr, "Failed call to "
> +                                "glGetActiveAtomicCounterBufferiv didn't "
> +                                "preserve the output parameter contents.\n");
> +                        piglit_report_result(PIGLIT_FAIL);
> +                }
>           }
>   
>           for (i = 0; i < n; ++i) {
>                   const struct buffer_info *binfo;
>                   int binding, data_size, num_counters, ref;
>                   GLuint counters[4];
>   
>                   glGetActiveAtomicCounterBufferiv(
>                           prog, i, GL_ATOMIC_COUNTER_BUFFER_BINDING, &binding);
>                   if (!piglit_check_gl_error(GL_NO_ERROR)) {
> diff --git a/tests/spec/arb_shader_atomic_counters/array-indexing.c b/tests/spec/arb_shader_atomic_counters/array-indexing.c
> index c35da2a..e1a816d 100644
> --- a/tests/spec/arb_shader_atomic_counters/array-indexing.c
> +++ b/tests/spec/arb_shader_atomic_counters/array-indexing.c
> @@ -29,20 +29,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   set_uniform_int(GLuint prog, const char *name, int value)
>   {
>           int loc;
>   
>           glLinkProgram(prog);
>           glUseProgram(prog);
> diff --git a/tests/spec/arb_shader_atomic_counters/buffer-binding.c b/tests/spec/arb_shader_atomic_counters/buffer-binding.c
> index 681d516..7eeaae9 100644
> --- a/tests/spec/arb_shader_atomic_counters/buffer-binding.c
> +++ b/tests/spec/arb_shader_atomic_counters/buffer-binding.c
> @@ -30,20 +30,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   run_test_bind_at(unsigned i)
>   {
>           GLuint buffer;
>   
>           glGenBuffers(1, &buffer);
>   
> @@ -67,25 +68,27 @@ run_test_bind_range(unsigned i)
>           glGenBuffers(1, &buffer);
>   
>           glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER, i, buffer);
>           if (!piglit_check_gl_error(GL_NO_ERROR)) {
>                   printf("Initial buffer binding failed.\n");
>                   return false;
>           }
>   
>           glBufferData(GL_ATOMIC_COUNTER_BUFFER, 16, NULL, GL_STATIC_DRAW);
>   
> -        glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, i, buffer, 6, 5);
> -        if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
> -                printf("Misaligned buffer range binding didn't generate a"
> -                       " GL_INVALID_VALUE error.\n");
> -                return false;
> +        if (!piglit_khr_no_error) {
> +                glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, i, buffer, 6, 5);
> +                if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
> +                        printf("Misaligned buffer range binding didn't "
> +                               "generate a GL_INVALID_VALUE error.\n");
> +                        return false;
> +                }
>           }
>   
>           glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, i, buffer, 8, 5);
>           if (!piglit_check_gl_error(GL_NO_ERROR)) {
>                   printf("Buffer range binding failed.\n");
>                   return false;
>           }
>   
>           glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING, &binding);
>           if (!piglit_check_gl_error(GL_NO_ERROR) ||
> diff --git a/tests/spec/arb_shader_atomic_counters/default-partition.c b/tests/spec/arb_shader_atomic_counters/default-partition.c
> index b9dbdf9..f420935 100644
> --- a/tests/spec/arb_shader_atomic_counters/default-partition.c
> +++ b/tests/spec/arb_shader_atomic_counters/default-partition.c
> @@ -34,20 +34,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   run_test(unsigned max_uniforms)
>   {
>           const char *fs_template = "#version 140\n"
>                   "#extension GL_ARB_shader_atomic_counters : enable\n"
>                   "\n"
>                   "#define N %d\n"
> diff --git a/tests/spec/arb_shader_atomic_counters/fragment-discard.c b/tests/spec/arb_shader_atomic_counters/fragment-discard.c
> index a4f54d2..da45f15 100644
> --- a/tests/spec/arb_shader_atomic_counters/fragment-discard.c
> +++ b/tests/spec/arb_shader_atomic_counters/fragment-discard.c
> @@ -32,20 +32,21 @@
>   #define L 256
>   #define N (L * L)
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   run_test(void)
>   {
>           const char *fs_source = "#version 140\n"
>                   "#extension GL_ARB_shader_atomic_counters : enable\n"
>                   "\n"
>                   "layout(binding = 0, offset = 0) uniform atomic_uint x;\n"
> diff --git a/tests/spec/arb_shader_atomic_counters/function-argument.c b/tests/spec/arb_shader_atomic_counters/function-argument.c
> index 4161160..35bf6b9 100644
> --- a/tests/spec/arb_shader_atomic_counters/function-argument.c
> +++ b/tests/spec/arb_shader_atomic_counters/function-argument.c
> @@ -32,20 +32,21 @@
>   #define L 256
>   #define N (L * L)
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   run_test(void)
>   {
>           const char *fs_source = "#version 140\n"
>                   "#extension GL_ARB_shader_atomic_counters : enable\n"
>                   "\n"
>                   "layout(binding = 0, offset = 0) uniform atomic_uint x;\n"
> diff --git a/tests/spec/arb_shader_atomic_counters/max-counters.c b/tests/spec/arb_shader_atomic_counters/max-counters.c
> index 8209f0d..f3df5f8 100644
> --- a/tests/spec/arb_shader_atomic_counters/max-counters.c
> +++ b/tests/spec/arb_shader_atomic_counters/max-counters.c
> @@ -29,20 +29,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static char *
>   iterate_template(const char *template, unsigned n)
>   {
>           char *ss;
>           int i, ret;
>   
>           ss = strdup("");
> diff --git a/tests/spec/arb_shader_atomic_counters/minmax.c b/tests/spec/arb_shader_atomic_counters/minmax.c
> index 73b68e7..c67544f 100644
> --- a/tests/spec/arb_shader_atomic_counters/minmax.c
> +++ b/tests/spec/arb_shader_atomic_counters/minmax.c
> @@ -31,20 +31,21 @@
>   #include "minmax-test.h"
>   
>   #define L 1
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>           config.window_width = L;
>           config.window_height = L;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   enum piglit_result
>   piglit_display(void)
>   {
>           return PIGLIT_FAIL;
>   }
>   
>   void
> diff --git a/tests/spec/arb_shader_atomic_counters/multiple-defs.c b/tests/spec/arb_shader_atomic_counters/multiple-defs.c
> index 4418c03..b752fc2 100644
> --- a/tests/spec/arb_shader_atomic_counters/multiple-defs.c
> +++ b/tests/spec/arb_shader_atomic_counters/multiple-defs.c
> @@ -29,20 +29,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   const char *frag_src = "#version 140\n"
>           "#extension GL_ARB_shader_atomic_counters : enable\n"
>           "\n"
>           "flat in ivec4 vcolor;\n"
>           "out ivec4 fcolor;\n"
>           "\n"
>           "layout(binding=3, offset=4) uniform atomic_uint x0;\n"
> diff --git a/tests/spec/arb_shader_atomic_counters/respecify-buffer.c b/tests/spec/arb_shader_atomic_counters/respecify-buffer.c
> index ba0237a..e601ff8 100644
> --- a/tests/spec/arb_shader_atomic_counters/respecify-buffer.c
> +++ b/tests/spec/arb_shader_atomic_counters/respecify-buffer.c
> @@ -30,20 +30,21 @@
>    * This demonstrates a mesa bug.
>    */
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   int data[] = { 0, 1, 2, 3 };
>   
>   float red[] = { 1, 0, 0 };
>   float green[] = { 0, 1, 0 };
>   float blue[] = { 0, 0, 1 };
>   float white[] = { 1, 1, 1 };
>   
> diff --git a/tests/spec/arb_shader_atomic_counters/semantics.c b/tests/spec/arb_shader_atomic_counters/semantics.c
> index 931f030..7da3583 100644
> --- a/tests/spec/arb_shader_atomic_counters/semantics.c
> +++ b/tests/spec/arb_shader_atomic_counters/semantics.c
> @@ -30,20 +30,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   atomic_counters_expected_binding(GLuint prog,
>                                    GLuint binding)
>   {
>           GLint param;
>   
>           glGetActiveAtomicCounterBufferiv(prog, 0,
> diff --git a/tests/spec/arb_shader_atomic_counters/unique-id.c b/tests/spec/arb_shader_atomic_counters/unique-id.c
> index e264bf0..dee11a5 100644
> --- a/tests/spec/arb_shader_atomic_counters/unique-id.c
> +++ b/tests/spec/arb_shader_atomic_counters/unique-id.c
> @@ -33,20 +33,21 @@
>   #define L 256
>   #define N (L * L)
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   check(int dx, int dy, uint32_t start_value, uint32_t end_value)
>   {
>           const uint32_t base = MIN2(start_value, end_value);
>           const uint32_t size = MAX2(start_value, end_value) - base;
>           uint32_t pixels[L][L];
>           uint32_t *frequency = malloc(size * sizeof(uint32_t));
> diff --git a/tests/spec/arb_shader_atomic_counters/unused-result.c b/tests/spec/arb_shader_atomic_counters/unused-result.c
> index f2fde30..83dd43f 100644
> --- a/tests/spec/arb_shader_atomic_counters/unused-result.c
> +++ b/tests/spec/arb_shader_atomic_counters/unused-result.c
> @@ -30,20 +30,21 @@
>   
>   #include "common.h"
>   
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>   
>           config.supports_gl_core_version = 31;
>   
>           config.window_width = 1;
>           config.window_height = 1;
>           config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
>   static bool
>   run_test_vertex(void)
>   {
>           const char *fs_source = "#version 140\n"
>                   "out ivec4 fcolor;\n"
>                   "void main() {\n"
>                   "       fcolor = ivec4(0);\n"
> 


More information about the Piglit mailing list