[Piglit] [PATCH] arb_shader_image_load_store: fix syntax error in execution tests

Francisco Jerez currojerez at riseup.net
Tue Jan 19 18:02:39 PST 2016


Timothy Arceri <timothy.arceri at collabora.com> writes:

> In GLSL 1.50 layout qualifiers must come before the storage
> qualifier. A recent fix in Mesa exposed this issue.
>
Seems unfortunate that in order to work around that restriction you had
to hardcode the uniform storage qualifier in the IMAGE_T macro, because
images are allowed to be declared in contexts other than uniform
declarations and the macro was expected to be useful in such cases too.
Could you rename it to IMAGE_UNIFORM_T as part of this commit to make it
clear that it's no longer useful to declare non-uniform images?

> Cc: Francisco Jerez <currojerez at riseup.net>
> ---
>  tests/spec/arb_shader_image_load_store/atomicity.c          | 2 +-
>  tests/spec/arb_shader_image_load_store/bitcast.c            | 2 +-
>  tests/spec/arb_shader_image_load_store/coherency.c          | 4 ++--
>  tests/spec/arb_shader_image_load_store/dead-fragments.c     | 2 +-
>  tests/spec/arb_shader_image_load_store/early-z.c            | 2 +-
>  tests/spec/arb_shader_image_load_store/grid.c               | 6 +++---
>  tests/spec/arb_shader_image_load_store/host-mem-barrier.c   | 4 ++--
>  tests/spec/arb_shader_image_load_store/indexing.c           | 2 +-
>  tests/spec/arb_shader_image_load_store/invalid.c            | 2 +-
>  tests/spec/arb_shader_image_load_store/layer.c              | 2 +-
>  tests/spec/arb_shader_image_load_store/level.c              | 2 +-
>  tests/spec/arb_shader_image_load_store/max-images.c         | 2 +-
>  tests/spec/arb_shader_image_load_store/max-size.c           | 4 ++--
>  tests/spec/arb_shader_image_load_store/restrict.c           | 4 ++--
>  tests/spec/arb_shader_image_load_store/semantics.c          | 4 ++--
>  tests/spec/arb_shader_image_load_store/shader-mem-barrier.c | 2 +-
>  tests/spec/arb_shader_image_load_store/state.c              | 2 +-
>  tests/spec/arb_shader_image_load_store/unused.c             | 2 +-
>  18 files changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/tests/spec/arb_shader_image_load_store/atomicity.c b/tests/spec/arb_shader_image_load_store/atomicity.c
> index 92e3afa..577804d 100644
> --- a/tests/spec/arb_shader_image_load_store/atomicity.c
> +++ b/tests/spec/arb_shader_image_load_store/atomicity.c
> @@ -128,7 +128,7 @@ run_test(uint32_t init_value, unsigned check_sz, uint32_t check_value,
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(img, ""),
> -                       hunk("volatile uniform IMAGE_T img;\n"),
> +                       hunk("volatile IMAGE_T img;\n"),
>                         hunk(op), NULL));
>          bool ret = prog &&
>                  init_fb(grid) &&
> diff --git a/tests/spec/arb_shader_image_load_store/bitcast.c b/tests/spec/arb_shader_image_load_store/bitcast.c
> index ab04ca1..650e51c 100644
> --- a/tests/spec/arb_shader_image_load_store/bitcast.c
> +++ b/tests/spec/arb_shader_image_load_store/bitcast.c
> @@ -126,7 +126,7 @@ run_test(const struct image_format_info *src_format,
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(dst_img, ""),
> -                       hunk("uniform IMAGE_T img;\n"
> +                       hunk("IMAGE_T img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        return imageLoad(img, IMAGE_ADDR(idx));\n"
> diff --git a/tests/spec/arb_shader_image_load_store/coherency.c b/tests/spec/arb_shader_image_load_store/coherency.c
> index 5a5bbdd..e693452 100644
> --- a/tests/spec/arb_shader_image_load_store/coherency.c
> +++ b/tests/spec/arb_shader_image_load_store/coherency.c
> @@ -142,7 +142,7 @@ run_test(const struct image_qualifier_info *qual,
>                  stage_w->stage,
>                  concat(qualifier_hunk(qual),
>                         image_hunk(img, ""),
> -                       hunk("IMAGE_Q uniform IMAGE_T img;\n"
> +                       hunk("IMAGE_Q IMAGE_T img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "       imageStore(img, idx, DATA_T(11, 22, 33, 44));"
> @@ -158,7 +158,7 @@ run_test(const struct image_qualifier_info *qual,
>                  stage_r->stage,
>                  concat(qualifier_hunk(qual),
>                         image_hunk(img, ""),
> -                       hunk("IMAGE_Q uniform IMAGE_T img;\n"
> +                       hunk("IMAGE_Q IMAGE_T img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "       DATA_T v = imageLoad(img, idx);"
> diff --git a/tests/spec/arb_shader_image_load_store/dead-fragments.c b/tests/spec/arb_shader_image_load_store/dead-fragments.c
> index d33fa02..e5cee28 100644
> --- a/tests/spec/arb_shader_image_load_store/dead-fragments.c
> +++ b/tests/spec/arb_shader_image_load_store/dead-fragments.c
> @@ -183,7 +183,7 @@ run_test(const struct image_op_info *op,
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(img, ""),
> -                       hunk("uniform IMAGE_T img;\n"),
> +                       hunk("IMAGE_T img;\n"),
>                         hunk(op->hunk),
>                         hunk(body), NULL));
>          bool ret = prog &&
> diff --git a/tests/spec/arb_shader_image_load_store/early-z.c b/tests/spec/arb_shader_image_load_store/early-z.c
> index 2485602..29e1cb4 100644
> --- a/tests/spec/arb_shader_image_load_store/early-z.c
> +++ b/tests/spec/arb_shader_image_load_store/early-z.c
> @@ -140,7 +140,7 @@ run_test_image(const char *input_layout, GLenum depth_func,
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(hunk(input_layout),
>                         image_hunk(img, ""),
> -                       hunk("uniform IMAGE_T img;\n"
> +                       hunk("IMAGE_T img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        imageStore(img, IMAGE_ADDR(idx),"
> diff --git a/tests/spec/arb_shader_image_load_store/grid.c b/tests/spec/arb_shader_image_load_store/grid.c
> index ba87899..d08d4e4 100644
> --- a/tests/spec/arb_shader_image_load_store/grid.c
> +++ b/tests/spec/arb_shader_image_load_store/grid.c
> @@ -64,7 +64,7 @@ image_hunk(const struct image_info img, const char *prefix)
>                   "                      ((idx).x + W * (idx).y))\n"
>                   "#define %sIMAGE_LAYOUT_Q layout(%s)\n"
>                   "#define %sIMAGE_BARE_T %s%s\n"
> -                 "#define %sIMAGE_T %sIMAGE_LAYOUT_Q %sIMAGE_BARE_T\n",
> +                 "#define %sIMAGE_T %sIMAGE_LAYOUT_Q uniform %sIMAGE_BARE_T\n",
>                   prefix, image_scalar_type_name(img.format),
>                   prefix, image_vector_type_name(img.format),
>                   prefix, image_format_scale(img.format).x,
> @@ -98,7 +98,7 @@ header_hunk(const struct grid_info grid)
>                   "#define H %d\n"
>                   "#define N %d\n"
>                   "#define GRID_T %s\n"
> -                 "#define RET_IMAGE_T layout(%s) %s2D\n",
> +                 "#define RET_IMAGE_T uniform layout(%s) %s2D\n",
>                   grid.size.x, grid.size.y, product(grid.size),
>                   image_vector_type_name(grid.format),
>                   grid.format->name, image_type_name(grid.format));
> @@ -227,7 +227,7 @@ generate_stage_source(const struct grid_info grid,
>                          body,
>                          hunk("layout (local_size_x = W) in;\n"
>                               "\n"
> -                             "uniform RET_IMAGE_T ret_img;\n"
> +                             "RET_IMAGE_T ret_img;\n"
>                               "\n"
>                               "void main() {\n"
>                               "       ivec2 idx = ivec2(gl_GlobalInvocationID);\n"
> diff --git a/tests/spec/arb_shader_image_load_store/host-mem-barrier.c b/tests/spec/arb_shader_image_load_store/host-mem-barrier.c
> index 833d7ec..57c325d 100644
> --- a/tests/spec/arb_shader_image_load_store/host-mem-barrier.c
> +++ b/tests/spec/arb_shader_image_load_store/host-mem-barrier.c
> @@ -71,8 +71,8 @@ common_hunk(const struct image_info img)
>                        hunk("#define RED DATA_T(1, 0, 0, 1)\n"
>                             "#define GREEN DATA_T(0, 1, 0, 1)\n"
>                             "\n"
> -                           "uniform IMAGE_T src_img;\n"
> -                           "uniform IMAGE_T dst_img;\n"
> +                           "IMAGE_T src_img;\n"
> +                           "IMAGE_T dst_img;\n"
>                             "uniform int pass;\n"), NULL);
>  }
>  
> diff --git a/tests/spec/arb_shader_image_load_store/indexing.c b/tests/spec/arb_shader_image_load_store/indexing.c
> index cab7d3f..de695c5 100644
> --- a/tests/spec/arb_shader_image_load_store/indexing.c
> +++ b/tests/spec/arb_shader_image_load_store/indexing.c
> @@ -125,7 +125,7 @@ run_test(const struct image_stage_info *stage)
>                  grid, stage->stage ,
>                  concat(image_hunk(img, ""),
>                         hunk("uniform int u;\n"
> -                            "uniform IMAGE_T imgs[8];\n"
> +                            "IMAGE_T imgs[8];\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        int i;\n"
> diff --git a/tests/spec/arb_shader_image_load_store/invalid.c b/tests/spec/arb_shader_image_load_store/invalid.c
> index a0981e4..a7515b0 100644
> --- a/tests/spec/arb_shader_image_load_store/invalid.c
> +++ b/tests/spec/arb_shader_image_load_store/invalid.c
> @@ -316,7 +316,7 @@ run_test(const struct image_op_info *op,
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(prog_img, ""),
> -                       hunk("uniform IMAGE_T imgs[1];\n"
> +                       hunk("IMAGE_T imgs[1];\n"
>                              "uniform int u;\n"
>                              "uniform int off;\n"),
>                         hunk(op->hunk),
> diff --git a/tests/spec/arb_shader_image_load_store/layer.c b/tests/spec/arb_shader_image_load_store/layer.c
> index 8cf2673..bace18b 100644
> --- a/tests/spec/arb_shader_image_load_store/layer.c
> +++ b/tests/spec/arb_shader_image_load_store/layer.c
> @@ -176,7 +176,7 @@ run_test(const struct image_target_info *target,
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(slice_img, ""),
> -                       hunk("uniform IMAGE_T img;\n"
> +                       hunk("IMAGE_T img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        GRID_T v = imageLoad(img, IMAGE_ADDR(idx));\n"
> diff --git a/tests/spec/arb_shader_image_load_store/level.c b/tests/spec/arb_shader_image_load_store/level.c
> index 5fbdbaf..dc664d8 100644
> --- a/tests/spec/arb_shader_image_load_store/level.c
> +++ b/tests/spec/arb_shader_image_load_store/level.c
> @@ -153,7 +153,7 @@ run_test(const struct image_target_info *target)
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(level_img, ""),
> -                       hunk("uniform IMAGE_T img;\n"
> +                       hunk("IMAGE_T img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        GRID_T v = imageLoad(img, IMAGE_ADDR(idx));\n"
> diff --git a/tests/spec/arb_shader_image_load_store/max-images.c b/tests/spec/arb_shader_image_load_store/max-images.c
> index 1e1186c..a0ff358 100644
> --- a/tests/spec/arb_shader_image_load_store/max-images.c
> +++ b/tests/spec/arb_shader_image_load_store/max-images.c
> @@ -159,7 +159,7 @@ generate_source(const struct grid_info grid,
>                   */
>                  return concat(stage_hunk(grid, stage),
>                                image_hunk(img, ""),
> -                              hunk("uniform IMAGE_T IMGS[NUM_IMGS];\n"
> +                              hunk("IMAGE_T IMGS[NUM_IMGS];\n"
>                                     "\n"
>                                     "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                                     "        int i;\n"
> diff --git a/tests/spec/arb_shader_image_load_store/max-size.c b/tests/spec/arb_shader_image_load_store/max-size.c
> index bd08091..0a02952 100644
> --- a/tests/spec/arb_shader_image_load_store/max-size.c
> +++ b/tests/spec/arb_shader_image_load_store/max-size.c
> @@ -92,8 +92,8 @@ run_test(const struct image_target_info *target,
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(img, ""),
> -                       hunk("readonly uniform IMAGE_T src_img;\n"
> -                            "writeonly uniform IMAGE_T dst_img;\n"
> +                       hunk("readonly IMAGE_T src_img;\n"
> +                            "writeonly IMAGE_T dst_img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        imageStore(dst_img, IMAGE_ADDR(idx),"
> diff --git a/tests/spec/arb_shader_image_load_store/restrict.c b/tests/spec/arb_shader_image_load_store/restrict.c
> index 32d3092..ae0ee77 100644
> --- a/tests/spec/arb_shader_image_load_store/restrict.c
> +++ b/tests/spec/arb_shader_image_load_store/restrict.c
> @@ -128,8 +128,8 @@ run_test(const struct image_qualifier_info *qual)
>                  GL_FRAGMENT_SHADER,
>                  concat(qualifier_hunk(qual),
>                         image_hunk(img, ""),
> -                       hunk("IMAGE_Q uniform IMAGE_T src_img;\n"
> -                            "IMAGE_Q uniform IMAGE_T dst_img;\n"
> +                       hunk("IMAGE_Q IMAGE_T src_img;\n"
> +                            "IMAGE_Q IMAGE_T dst_img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        int i;\n"
> diff --git a/tests/spec/arb_shader_image_load_store/semantics.c b/tests/spec/arb_shader_image_load_store/semantics.c
> index 122e490..e803621 100644
> --- a/tests/spec/arb_shader_image_load_store/semantics.c
> +++ b/tests/spec/arb_shader_image_load_store/semantics.c
> @@ -322,8 +322,8 @@ run_test(const struct image_op_info *op,
>          GLuint prog = generate_program(
>                  grid, stage->stage,
>                  concat(image_hunk(img, ""),
> -                       hunk("uniform IMAGE_T img;\n"
> -                            "uniform IMAGE_T arg_img;\n"
> +                       hunk("IMAGE_T img;\n"
> +                            "IMAGE_T arg_img;\n"
>                              "\n"
>                              "GRID_T arg(ivec2 idx) {\n"
>                              "        return imageLoad(arg_img, IMAGE_ADDR(idx));\n"
> diff --git a/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c b/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c
> index c5011f9..2476d96 100644
> --- a/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c
> +++ b/tests/spec/arb_shader_image_load_store/shader-mem-barrier.c
> @@ -129,7 +129,7 @@ run_test(const struct image_test_info *test,
>                  grid, stage->stage,
>                  concat(test_hunk(test, k),
>                         image_hunk(img, ""),
> -                       hunk("IMAGE_Q uniform IMAGE_T img;\n"
> +                       hunk("IMAGE_Q IMAGE_T img;\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T arg) {\n"
>                              "       /*\n"
> diff --git a/tests/spec/arb_shader_image_load_store/state.c b/tests/spec/arb_shader_image_load_store/state.c
> index bc25b56..66cb6d4 100644
> --- a/tests/spec/arb_shader_image_load_store/state.c
> +++ b/tests/spec/arb_shader_image_load_store/state.c
> @@ -359,7 +359,7 @@ run_test_uniform(void)
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(image_info_for_grid(grid), ""),
> -                       hunk("uniform IMAGE_T imgs[2];\n"
> +                       hunk("IMAGE_T imgs[2];\n"
>                              "\n"
>                              "GRID_T op(ivec2 idx, GRID_T x) {\n"
>                              "        imageStore(imgs[0], IMAGE_ADDR(idx), x);\n"
> diff --git a/tests/spec/arb_shader_image_load_store/unused.c b/tests/spec/arb_shader_image_load_store/unused.c
> index 91fa5c5..1b4f692 100644
> --- a/tests/spec/arb_shader_image_load_store/unused.c
> +++ b/tests/spec/arb_shader_image_load_store/unused.c
> @@ -82,7 +82,7 @@ run_test(uint32_t init_value, uint32_t check_value,
>          GLuint prog = generate_program(
>                  grid, GL_FRAGMENT_SHADER,
>                  concat(image_hunk(img, ""),
> -                       hunk("uniform IMAGE_T img;\n"),
> +                       hunk("IMAGE_T img;\n"),
>                         hunk(op), NULL));
>          bool ret = prog &&
>                  init_fb(grid) &&
> -- 
> 2.4.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20160119/e562bf93/attachment.sig>


More information about the Piglit mailing list