llvmpipe, draw: improve shader cache debugging
authorRoland Scheidegger <sroland@vmware.com>
Fri, 8 Sep 2017 00:59:11 +0000 (02:59 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 9 Sep 2017 01:06:10 +0000 (03:06 +0200)
commit57a341b0a94d37e2aee5380703d171c422d8550e
treec23dd782cb5a7c140b47ab62409b7be8e00a8708
parent772f475351d63067f8fd0251e2fe6a33aedf1f56
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 <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
src/gallium/drivers/llvmpipe/lp_state_fs.c