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

Author: Jason Ekstrand <[email protected]>
Date:   Wed Sep 23 15:54:34 2020 -0500

spirv: vtn_fail with a nice message on unsupported rounding modes

Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6845>

---

 src/compiler/spirv/spirv_info.h    | 1 +
 src/compiler/spirv/spirv_info_c.py | 1 +
 src/compiler/spirv/vtn_alu.c       | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/compiler/spirv/spirv_info.h b/src/compiler/spirv/spirv_info.h
index 8b8b68723fb..c9bfcda18d0 100644
--- a/src/compiler/spirv/spirv_info.h
+++ b/src/compiler/spirv/spirv_info.h
@@ -38,5 +38,6 @@ const char 
*spirv_imageoperands_to_string(SpvImageOperandsMask op);
 const char *spirv_memorymodel_to_string(SpvMemoryModel cap);
 const char *spirv_op_to_string(SpvOp op);
 const char *spirv_storageclass_to_string(SpvStorageClass sc);
+const char *spirv_fproundingmode_to_string(SpvFPRoundingMode sc);
 
 #endif /* SPIRV_INFO_H */
diff --git a/src/compiler/spirv/spirv_info_c.py 
b/src/compiler/spirv/spirv_info_c.py
index 29baec1fc30..f1a1e272083 100644
--- a/src/compiler/spirv/spirv_info_c.py
+++ b/src/compiler/spirv/spirv_info_c.py
@@ -124,6 +124,7 @@ if __name__ == "__main__":
         collect_data(spirv_info, "MemoryModel"),
         collect_data(spirv_info, "StorageClass"),
         collect_data(spirv_info, "ImageOperands"),
+        collect_data(spirv_info, "FPRoundingMode"),
         collect_opcodes(spirv_info),
     ]
 
diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c
index b403a25e51b..6d64dd752f3 100644
--- a/src/compiler/spirv/vtn_alu.c
+++ b/src/compiler/spirv/vtn_alu.c
@@ -388,7 +388,8 @@ handle_rounding_mode(struct vtn_builder *b, struct 
vtn_value *val, int member,
       *out_rounding_mode = nir_rounding_mode_rtz;
       break;
    default:
-      unreachable("Not supported rounding mode");
+      vtn_fail("Unsupported rounding mode: %s",
+               spirv_fproundingmode_to_string(dec->operands[0]));
       break;
    }
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to