radv: Don't free NIR shaders if tracing
authorAlex Smith <asmith@feralinteractive.com>
Wed, 18 Oct 2017 14:08:20 +0000 (15:08 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 18 Oct 2017 18:37:10 +0000 (20:37 +0200)
Fixes a crash while generating a hang report.

Fixes: 7d45d22fdd2e ("radv: switch to using radv_create_shaders()")
Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c

index 0b95d008c07d0551b3ab9f2dfab85088781ce385..c93871bfbcff112efd54b0b3150d6f135e461432 100644 (file)
@@ -1691,7 +1691,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
 
        for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
                free(codes[i]);
-               if (modules[i] && !modules[i]->nir)
+               if (modules[i] && !modules[i]->nir && !pipeline->device->trace_bo)
                        ralloc_free(nir[i]);
        }