From a2a350a3be1a4f3dec8cc3264a19eb877d606628 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 22 Sep 2017 16:44:08 +0200 Subject: radv: dump NIR when a GPU hang is detected This looks a bit ugly to me, but the existing codepath is not terribly elegant as well. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_pipeline.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/amd/vulkan/radv_pipeline.c') diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 228fdf4ab07..5800f297074 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -139,7 +139,7 @@ radv_pipeline_compile(struct radv_pipeline *pipeline, return NULL; if (!variant) { - variant = radv_shader_variant_create(pipeline->device, nir, + variant = radv_shader_variant_create(pipeline->device, module, nir, layout, key, &code, &code_size); } @@ -163,7 +163,7 @@ radv_pipeline_compile(struct radv_pipeline *pipeline, free(gs_copy_code); } - if (!module->nir) + if (!module->nir && !pipeline->device->trace_bo) ralloc_free(nir); if (variant) @@ -270,7 +270,7 @@ radv_tess_pipeline_compile(struct radv_pipeline *pipeline, nir_lower_tes_patch_vertices(tes_nir, tcs_nir->info.tess.tcs_vertices_out); - tes_variant = radv_shader_variant_create(pipeline->device, tes_nir, + tes_variant = radv_shader_variant_create(pipeline->device, tes_module, tes_nir, layout, &tes_key, &tes_code, &tes_code_size); @@ -282,14 +282,14 @@ radv_tess_pipeline_compile(struct radv_pipeline *pipeline, radv_hash_shader(tcs_sha1, tcs_module, tcs_entrypoint, tcs_spec_info, layout, &tcs_key, 0); - tcs_variant = radv_shader_variant_create(pipeline->device, tcs_nir, + tcs_variant = radv_shader_variant_create(pipeline->device, tcs_module, tcs_nir, layout, &tcs_key, &tcs_code, &tcs_code_size); - if (!tes_module->nir) + if (!tes_module->nir && !pipeline->device->trace_bo) ralloc_free(tes_nir); - if (!tcs_module->nir) + if (!tcs_module->nir && !pipeline->device->trace_bo) ralloc_free(tcs_nir); if (tes_variant) -- cgit v1.2.3