From eeb6d6112859c3ba41f1c8914d503bf1a3dd981d Mon Sep 17 00:00:00 2001 From: Elie Tournier Date: Mon, 3 Feb 2020 15:33:34 +0000 Subject: [PATCH] spirv2nir: print nir shader if translation succed Signed-off-by: Elie Tournier Reviewed-by: Erik Faye-Lund Part-of: --- src/compiler/spirv/spirv2nir.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); -- 2.30.2