From d4280561f582f79559d98467650c805e1824b21d Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 23 Feb 2018 15:56:03 -0500 Subject: [PATCH] nir/spirv: print extension name in fail msg Reviewed-by: Karol Herbst Reviewed-by: Jason Ekstrand Signed-off-by: Karol Herbst --- src/compiler/spirv/spirv_to_nir.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index aad4c71..413fbf4 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -383,19 +383,20 @@ static void vtn_handle_extension(struct vtn_builder *b, SpvOp opcode, const uint32_t *w, unsigned count) { + const char *ext = (const char *)&w[2]; switch (opcode) { case SpvOpExtInstImport: { struct vtn_value *val = vtn_push_value(b, w[1], vtn_value_type_extension); - if (strcmp((const char *)&w[2], "GLSL.std.450") == 0) { + if (strcmp(ext, "GLSL.std.450") == 0) { val->ext_handler = vtn_handle_glsl450_instruction; - } else if ((strcmp((const char *)&w[2], "SPV_AMD_gcn_shader") == 0) + } else if ((strcmp(ext, "SPV_AMD_gcn_shader") == 0) && (b->options && b->options->caps.gcn_shader)) { val->ext_handler = vtn_handle_amd_gcn_shader_instruction; - } else if ((strcmp((const char *)&w[2], "SPV_AMD_shader_trinary_minmax") == 0) + } else if ((strcmp(ext, "SPV_AMD_shader_trinary_minmax") == 0) && (b->options && b->options->caps.trinary_minmax)) { val->ext_handler = vtn_handle_amd_shader_trinary_minmax_instruction; } else { - vtn_fail("Unsupported extension"); + vtn_fail("Unsupported extension: %s", ext); } break; } -- 2.7.4