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 <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user