gallivm: simplify sampler interface

Graphics / Mesa 3D Graphics Library / Mesa - Roland Scheidegger [vmware.com] - 31 March 2015 10:23 UTC

This has got a bit out of control with more and more parameters added. Worse, whenever something in there changes all callees have to be updated for that, even though they don't really do much with any parameter in there except pass it on to the actual sampling function. Hence simply put almost everything into a struct. Also instead of relying on some arguments being NULL, be explicit and set this in a key (which is just reused for function generation for simplicity). (The code still relies on them being NULL in the end for now.) Technically there is a minimal functional change here for shadow sampling: if shadow sampling is done is now determined explicitly by the texture function (either sample_c or the gl-style tex func inherit this from target) instead of the static texture state. These two should always match, however. Otherwise, it should generate all the same code.

1863ed2 gallivm: simplify sampler interface
src/gallium/auxiliary/draw/draw_llvm_sample.c | 31 +--
src/gallium/auxiliary/gallivm/lp_bld_sample.h | 48 +++--
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 227 +++++++++------------
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h | 17 +-
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 133 ++++++------
src/gallium/drivers/llvmpipe/lp_tex_sample.c | 33 +--
6 files changed, 218 insertions(+), 271 deletions(-)

Upstream: cgit.freedesktop.org


  • Share