gallivm: (trivial) fix using one lod instead of per-quad lod for texel fetch
authorRoland Scheidegger <sroland@vmware.com>
Fri, 5 Jul 2013 16:06:17 +0000 (18:06 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 5 Jul 2013 16:07:51 +0000 (18:07 +0200)
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

index 4b5674197f094d436686899011964a1bfcc4f609..fa9edb5489c48939954821955d0a38a91fdcd449 100644 (file)
@@ -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 {