radeonsi: dump shaders after si_shader_binary_upload to fix printed LDS stat

lds_size is set by si_shader_binary_upload, so it always printed zero.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15965>
This commit is contained in:
Marek Olšák
2022-04-10 21:12:37 -04:00
committed by Marge Bot
parent 9d3357141e
commit ef52d803a9
3 changed files with 15 additions and 14 deletions
+6 -4
View File
@@ -177,11 +177,11 @@ static void si_create_compute_state_async(void *job, void *gdata, int thread_ind
if (si_shader_cache_load_shader(sscreen, ir_sha1_cache_key, shader)) {
simple_mtx_unlock(&sscreen->shader_cache_mutex);
si_shader_dump_stats_for_shader_db(sscreen, shader, debug);
si_shader_dump(sscreen, shader, debug, stderr, true);
if (!si_shader_binary_upload(sscreen, shader, 0))
program->shader.compilation_failed = true;
si_shader_dump_stats_for_shader_db(sscreen, shader, debug);
si_shader_dump(sscreen, shader, debug, stderr, true);
} else {
simple_mtx_unlock(&sscreen->shader_cache_mutex);
@@ -274,8 +274,10 @@ static void *si_create_compute_state(struct pipe_context *ctx, const struct pipe
const amd_kernel_code_t *code_object = si_compute_get_code_object(program, 0);
code_object_to_config(code_object, &program->shader.config);
bool ok = si_shader_binary_upload(sctx->screen, &program->shader, 0);
si_shader_dump(sctx->screen, &program->shader, &sctx->debug, stderr, true);
if (!si_shader_binary_upload(sctx->screen, &program->shader, 0)) {
if (!ok) {
fprintf(stderr, "LLVM failed to upload shader\n");
free((void *)program->shader.binary.elf_buffer);
FREE(program);
+5 -6
View File
@@ -2246,15 +2246,14 @@ bool si_create_shader_variant(struct si_screen *sscreen, struct ac_llvm_compiler
}
si_fix_resource_usage(sscreen, shader);
si_shader_dump(sscreen, shader, debug, stderr, true);
/* Upload. */
if (!si_shader_binary_upload(sscreen, shader, 0)) {
fprintf(stderr, "LLVM failed to upload shader\n");
return false;
}
bool ok = si_shader_binary_upload(sscreen, shader, 0);
si_shader_dump(sscreen, shader, debug, stderr, true);
return true;
if (!ok)
fprintf(stderr, "LLVM failed to upload shader\n");
return ok;
}
void si_shader_binary_clean(struct si_shader_binary *binary)
@@ -533,13 +533,13 @@ struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen,
bool ok = false;
if (si_compile_llvm(sscreen, &ctx.shader->binary, &ctx.shader->config, ctx.compiler, &ctx.ac,
debug, MESA_SHADER_GEOMETRY, "GS Copy Shader", false)) {
if (si_can_dump_shader(sscreen, MESA_SHADER_GEOMETRY))
fprintf(stderr, "GS Copy Shader:\n");
si_shader_dump(sscreen, ctx.shader, debug, stderr, true);
assert(!ctx.shader->config.scratch_bytes_per_wave);
if (!ctx.shader->config.scratch_bytes_per_wave)
ok = si_shader_binary_upload(sscreen, ctx.shader, 0);
if (si_can_dump_shader(sscreen, MESA_SHADER_GEOMETRY))
fprintf(stderr, "GS Copy Shader:\n");
si_shader_dump(sscreen, ctx.shader, debug, stderr, true);
}
si_llvm_dispose(&ctx);