spirv: vtn_fail with a nice message on unsupported rounding modes

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6845>
This commit is contained in:
Jason Ekstrand 2020-09-23 15:54:34 -05:00 committed by Marge Bot
parent 03e7b75c22
commit 3173367a47
3 changed files with 4 additions and 1 deletions

View File

@ -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 */

View File

@ -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),
]

View File

@ -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;
}
}