Mesa (master): spirv: don't assert with location decorations on non i/ o variables

Lionel Landwerlin llandwerlin at kemper.freedesktop.org
Fri Jan 20 21:41:00 UTC 2017


Module: Mesa
Branch: master
Commit: 8a28e764d0e28d0d4dfa3b81b89fa3baf30e94f2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8a28e764d0e28d0d4dfa3b81b89fa3baf30e94f2

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Fri Jan 13 16:08:28 2017 +0000

spirv: don't assert with location decorations on non i/o variables

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 at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Cc: 17.0 <mesa-stable at lists.freedesktop.org>

---

 src/compiler/spirv/vtn_variables.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index a543a52..d55f81e 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -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) {




More information about the mesa-commit mailing list