glsl: add image_format check in cross_validate_globals()
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 5 Jan 2016 12:21:17 +0000 (13:21 +0100)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Wed, 13 Jan 2016 06:01:55 +0000 (07:01 +0100)
Fixes CTS test:

ES31-CTS.shader_image_load_store.negative-linkErrors

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93410

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/linker.cpp

index e8c0b98176065f1163550ff8cd138902abcab6f3..564c47128718f9af32ee1408a98c0394cd3dc740 100644 (file)
@@ -1133,6 +1133,12 @@ cross_validate_globals(struct gl_shader_program *prog,
                             mode_string(var), var->name);
                return;
             }
+            if (existing->data.image_format != var->data.image_format) {
+               linker_error(prog, "declarations for %s `%s` have "
+                            "mismatching image format qualifiers\n",
+                            mode_string(var), var->name);
+               return;
+            }
         } else
            variables.add_variable(var);
       }