spirv: don't assert with location decorations on non i/o variables
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 13 Jan 2017 16:08:28 +0000 (16:08 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 20 Jan 2017 21:39:46 +0000 (21:39 +0000)
Some applications might add location decoration to samplers. Rather
than raising an error it seems it would make more sense to just
discard these decorations.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: 17.0 <mesa-stable@lists.freedesktop.org>
src/compiler/spirv/vtn_variables.c

index a543a52dd0511eb23bf0ad1a3080ae7cc3eb937e..d55f81e5d34ba2694bea5106cbfb9e5725174ee1 100644 (file)
@@ -1199,7 +1199,8 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member,
          is_vertex_input = false;
          location += vtn_var->patch ? VARYING_SLOT_PATCH0 : VARYING_SLOT_VAR0;
       } else {
-         unreachable("Location must be on input or output variable");
+         vtn_warn("Location must be on input or output variable");
+         return;
       }
 
       if (vtn_var->var) {