llvmpipe: Trim the fragment shader cached based on LLVM IR instruction count.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 30 Nov 2011 17:12:00 +0000 (17:12 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 8 Dec 2011 17:59:33 +0000 (17:59 +0000)
commit6cf7245f6938e27c9b8a1742f27659aec017bbdc
tree79397228a7f7408efd756f6e58298ff9977204f7
parentf32c7232a8a16887af710a11f025381bc73640f0
llvmpipe: Trim the fragment shader cached based on LLVM IR instruction count.

Number of fragment shader variants is not very representative of the
memory used by LLVM, neither is number of shader instructions, as often
texture sampling constitutes most of the generated code.

This change adds an additional trim criteria: least recently used
fragment shader variants will be freed until the total number of LLVM IR
instruction falls below a specified threshold.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_type.c
src/gallium/auxiliary/gallivm/lp_bld_type.h
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_limits.h
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_fs.h