diff options
author | Roland Scheidegger <[email protected]> | 2017-09-08 02:59:11 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2017-09-09 03:06:10 +0200 |
commit | 57a341b0a94d37e2aee5380703d171c422d8550e (patch) | |
tree | c23dd782cb5a7c140b47ab62409b7be8e00a8708 /src/gallium/auxiliary/draw/draw_llvm.c | |
parent | 772f475351d63067f8fd0251e2fe6a33aedf1f56 (diff) |
llvmpipe, draw: improve shader cache debugging
With GALLIVM_DEBUG=perf set, output the relevant stats for shader cache usage
whenever we have to evict shader variants.
Also add some output when shaders are deleted (but not with the perf setting
to keep this one less noisy).
While here, also don't delete that many shaders when we have to evict. For fs,
there's potentially some cost if we have to evict due to the required flush,
however certainly shader recompiles have a high cost too so I don't think
evicting one quarter of the cache size makes sense (and, if we're evicting
based on IR count, we probably typically evict only very few or just one
shader too). For vs, I'm not sure it even makes sense to evict more than
one shader at a time, but keep the logic the same for now.
Reviewed-by: Jose Fonseca <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 203572010fc..8de29ea1fd4 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -2156,6 +2156,11 @@ draw_llvm_destroy_variant(struct draw_llvm_variant *variant) { struct draw_llvm *llvm = variant->llvm; + if (gallivm_debug & (GALLIVM_DEBUG_TGSI | GALLIVM_DEBUG_IR)) { + debug_printf("Deleting VS variant: %u vs variants,\t%u total variants\n", + variant->shader->variants_cached, llvm->nr_variants); + } + gallivm_destroy(variant->gallivm); remove_from_list(&variant->list_item_local); @@ -2418,6 +2423,11 @@ draw_gs_llvm_destroy_variant(struct draw_gs_llvm_variant *variant) { struct draw_llvm *llvm = variant->llvm; + if (gallivm_debug & (GALLIVM_DEBUG_TGSI | GALLIVM_DEBUG_IR)) { + debug_printf("Deleting GS variant: %u gs variants,\t%u total variants\n", + variant->shader->variants_cached, llvm->nr_gs_variants); + } + gallivm_destroy(variant->gallivm); remove_from_list(&variant->list_item_local); |