Mesa (master): gallivm: split sampler and texture state

Roland Scheidegger sroland at kemper.freedesktop.org
Mon Jan 28 15:00:08 UTC 2013


Module: Mesa
Branch: master
Commit: c789b981b244333cfc903bcd1e2fefc010500013
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c789b981b244333cfc903bcd1e2fefc010500013

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Mon Jan 28 06:50:36 2013 -0800

gallivm: split sampler and texture state

Split the sampler interface to use separate sampler and texture (sampler_view)
state. This is needed to support dx10-style sampling instructions.
This is not quite complete since both draw/llvmpipe don't really track
textures/samplers independently yet, as well as the gallivm code not quite
using the right sampler or texture index respectively (but it should work
for the sampling codes used by opengl).
We are however losing some optimizations in the process, apply_max_lod will
no longer work, and we potentially could end up with more (unnecessary)
recompiles (if switching textures with/without mipmaps only so it shouldn't
be too bad).

v2: don't use different callback structs for sampler/sampler view functions
(which just complicates things), fix up sampling code to actually use the
right texture or sampler index, and similar for llvmpipe/draw actually
distinguish between samplers and sampler views.

v3: fix more of PIPE_MAX_SAMPLER / PIPE_MAX_SHADER_SAMPLER_VIEWS mismatches
(both in draw and llvmpipe), based on feedback from José get rid of unneeded
static sampler derived state.(which also fixes the only 2 piglit regressions
due to a forgotten assignment), fix comments based on Brian's feedback.

v4: remove some accidental unrelated whitespace changes

Reviewed-by: José Fonseca <jfonseca at vmware.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/auxiliary/draw/draw_context.c         |    4 +-
 src/gallium/auxiliary/draw/draw_llvm.c            |  126 ++++++++++-----
 src/gallium/auxiliary/draw/draw_llvm.h            |   66 ++++++--
 src/gallium/auxiliary/draw/draw_llvm_sample.c     |   95 +++++++++--
 src/gallium/auxiliary/draw/draw_private.h         |    2 +-
 src/gallium/auxiliary/gallivm/lp_bld_sample.c     |  108 ++++++++-----
 src/gallium/auxiliary/gallivm/lp_bld_sample.h     |   58 +++++--
 src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c |  104 ++++++------
 src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |  185 +++++++++++----------
 src/gallium/auxiliary/gallivm/lp_bld_tgsi.h       |    3 +-
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c   |    6 +-
 src/gallium/drivers/llvmpipe/lp_context.h         |    4 +-
 src/gallium/drivers/llvmpipe/lp_jit.c             |   54 ++++--
 src/gallium/drivers/llvmpipe/lp_jit.h             |   24 ++-
 src/gallium/drivers/llvmpipe/lp_setup.c           |   16 +-
 src/gallium/drivers/llvmpipe/lp_setup_context.h   |    2 +-
 src/gallium/drivers/llvmpipe/lp_state_fs.c        |   84 +++++++---
 src/gallium/drivers/llvmpipe/lp_state_fs.h        |   17 ++-
 src/gallium/drivers/llvmpipe/lp_state_sampler.c   |    6 +-
 src/gallium/drivers/llvmpipe/lp_tex_sample.c      |  102 +++++++++--
 20 files changed, 709 insertions(+), 357 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=c789b981b244333cfc903bcd1e2fefc010500013



More information about the mesa-commit mailing list