From: Elie Tournier Date: Mon, 3 Feb 2020 15:33:34 +0000 (+0000) Subject: spirv2nir: print nir shader if translation succed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eeb6d6112859c3ba41f1c8914d503bf1a3dd981d;p=mesa.git spirv2nir: print nir shader if translation succed Signed-off-by: Elie Tournier Reviewed-by: Erik Faye-Lund Part-of: --- diff --git a/src/compiler/spirv/spirv2nir.c b/src/compiler/spirv/spirv2nir.c index 72c607c458d..62bef2e4897 100644 --- a/src/compiler/spirv/spirv2nir.c +++ b/src/compiler/spirv/spirv2nir.c @@ -79,7 +79,11 @@ int main(int argc, char **argv) nir_shader *nir = spirv_to_nir(map, word_count, NULL, 0, MESA_SHADER_FRAGMENT, "main", &spirv_opts, NULL); - nir_print_shader(nir, stderr); + + if (nir) + nir_print_shader(nir, stderr); + else + fprintf(stderr, "SPIRV to NIR compilation failed\n"); glsl_type_singleton_decref();