radeonsi: count compilations in si_compile_llvm
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 15 Dec 2015 00:34:45 +0000 (19:34 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 29 Dec 2015 14:07:01 +0000 (09:07 -0500)
This changes the count slightly (because of si_generate_gs_copy_shader), but
this is only relevant for the driver-specific num-compilations query. It sets
the stage for the next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index 4a672766b0fab611639ee01c266fa1fce64fab93..511ed8829c67510363d1dc92b23274e029e19fbf 100644 (file)
@@ -3885,6 +3885,8 @@ int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader,
                                shader->selector ? shader->selector->tokens : NULL);
        bool dump_ir = dump_asm && !(sscreen->b.debug_flags & DBG_NO_IR);
 
+       p_atomic_inc(&sscreen->b.num_compilations);
+
        r = radeon_llvm_compile(mod, &shader->binary,
                r600_get_llvm_processor_name(sscreen->b.family), dump_ir, dump_asm, tm);
        if (r)
index f0147ce2bfc3db20d38781211986a355e7b94358..8700590435f78ba372a90630b95b04ca53794f63 100644 (file)
@@ -634,7 +634,6 @@ static int si_shader_select(struct pipe_context *ctx,
                sel->last_variant = shader;
        }
        state->current = shader;
-       p_atomic_inc(&sctx->screen->b.num_compilations);
        pipe_mutex_unlock(sel->mutex);
        return 0;
 }