radv: move nir print after linking is done
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 23 Oct 2017 22:08:55 +0000 (09:08 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 23 Oct 2017 23:41:38 +0000 (10:41 +1100)
We now have linking optimisations so we want to delay dumping the
nir until after these are complete.

Fixes: 06f05040eb73 (radv: Link shaders)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.c

index 30a90ac9608f55868bcf02dcdd4c975a9bfebaa6..d6b33a5327ef142f0991e4fc89701ceba2724f0b 100644 (file)
@@ -1870,8 +1870,13 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
 
        for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
                free(codes[i]);
-               if (modules[i] && !pipeline->device->trace_bo)
-                       ralloc_free(nir[i]);
+               if (modules[i]) {
+                       if (device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS)
+                               nir_print_shader(nir[i], stderr);
+
+                       if (!pipeline->device->trace_bo)
+                               ralloc_free(nir[i]);
+               }
        }
 
        if (fs_m.nir)
index 6176a2e590d5b42c857b8f39e093a2440dbc6ca3..5903917068747b4790395a5d54b62543b22ea444 100644 (file)
@@ -291,9 +291,6 @@ radv_shader_compile_to_nir(struct radv_device *device,
        nir_remove_dead_variables(nir, nir_var_local);
        radv_optimize_nir(nir);
 
-       if (device->instance->debug_flags & RADV_DEBUG_DUMP_SHADERS)
-               nir_print_shader(nir, stderr);
-
        return nir;
 }