radeonsi: move si_shader_dump call out of si_compile_llvm
authorMarek Olšák <marek.olsak@amd.com>
Sun, 3 Jan 2016 16:18:04 +0000 (17:18 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 7 Jan 2016 17:26:06 +0000 (18:26 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_shader.c

index 2380242a7fa01f4bf16edcefb66a3f658477bbb0..ffac656052706b8974a71dcc153f23434d2584ec 100644 (file)
@@ -125,6 +125,9 @@ static void *si_create_compute_state(
                        si_compile_llvm(sctx->screen, &program->kernels[i].binary,
                                        &program->kernels[i].config, sctx->tm,
                                        mod, &sctx->b.debug, TGSI_PROCESSOR_COMPUTE);
+                       si_shader_dump(sctx->screen, &program->kernels[i].binary,
+                                      &program->kernels[i].config,
+                                      &sctx->b.debug, TGSI_PROCESSOR_COMPUTE);
                        si_shader_binary_upload(sctx->screen, &program->kernels[i]);
                        LLVMDisposeModule(mod);
                }
index 36b0364a2045e4f17f322ece448debeb431fa823..500dd2b60c5d4737f1f320302a3afd0a9ff43b40 100644 (file)
@@ -3912,7 +3912,6 @@ int si_compile_llvm(struct si_screen *sscreen,
        }
 
        si_shader_binary_read_config(binary, conf, 0);
-       si_shader_dump(sscreen, binary, conf, debug, processor);
 
        FREE(binary->config);
        FREE(binary->global_symbol_offsets);
@@ -3995,8 +3994,12 @@ static int si_generate_gs_copy_shader(struct si_screen *sscreen,
                            &si_shader_ctx->shader->config, si_shader_ctx->tm,
                            bld_base->base.gallivm->module,
                            debug, TGSI_PROCESSOR_GEOMETRY);
-       if (!r)
+       if (!r) {
+               si_shader_dump(sscreen, &si_shader_ctx->shader->binary,
+                              &si_shader_ctx->shader->config, debug,
+                              TGSI_PROCESSOR_GEOMETRY);
                r = si_shader_binary_upload(sscreen, si_shader_ctx->shader);
+       }
 
        radeon_llvm_dispose(&si_shader_ctx->radeon_bld);
 
@@ -4198,6 +4201,9 @@ int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm,
                goto out;
        }
 
+       si_shader_dump(sscreen, &shader->binary, &shader->config,
+                      debug, si_shader_ctx.type);
+
        r = si_shader_binary_upload(sscreen, shader);
        if (r) {
                fprintf(stderr, "LLVM failed to upload shader\n");