Mesa (master): gallivm: (trivial) fix using one lod instead of per-quad lod for texel fetch

Roland Scheidegger sroland at kemper.freedesktop.org
Fri Jul 5 16:10:52 UTC 2013


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

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Fri Jul  5 18:06:17 2013 +0200

gallivm: (trivial) fix using one lod instead of per-quad lod for texel fetch

The logic for choosing number of lods was bogus.
(The code should ultimately handle the case of only one lod even with multiple
quads but currently can't.)

---

 src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 4b56741..fa9edb5 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -1588,7 +1588,8 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
         (!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)))
       bld.num_lods = type.length;
    /* TODO: for true scalar_lod should only use 1 lod value */
-   else if (!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE) {
+   else if ((is_fetch && explicit_lod && bld.static_texture_state->target != PIPE_BUFFER ) ||
+            (!is_fetch && mip_filter != PIPE_TEX_MIPFILTER_NONE)) {
       bld.num_lods = num_quads;
    }
    else {




More information about the mesa-commit mailing list