spirv2nir: print nir shader if translation succed

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3678>
This commit is contained in:
Elie Tournier 2020-02-03 15:33:34 +00:00 committed by Marge Bot
parent 7e80b03dd1
commit eeb6d61128

View file

@ -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();