summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/spirv/spirv2nir.c6
1 files changed, 5 insertions, 1 deletions
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();