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

Author: Roland Scheidegger <[email protected]>
Date:   Tue Aug 20 04:14:24 2013 +0200

gallivm: fix bogus aos path detection

Need to check the wrap mode of the actually used coords not a fixed 2.
While checking more than necessary would only potentially disable aos and
not cause any harm I'm pretty sure for 3d textures it could have caused
assertion failures (if s,t coords have simple filter and r not).

Reviewed-by: Jose Fonseca <[email protected]>

---

 src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c 
b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 9f781c5..6d12587 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -2034,21 +2034,27 @@ lp_build_sample_soa(struct gallivm_state *gallivm,
       LLVMValueRef lod_ipart = NULL, lod_fpart = NULL;
       LLVMValueRef ilevel0 = NULL, ilevel1 = NULL;
       boolean use_aos = util_format_fits_8unorm(bld.format_desc) &&
-                        lp_is_simple_wrap_mode(static_sampler_state->wrap_s) &&
-                        lp_is_simple_wrap_mode(static_sampler_state->wrap_t) &&
                         /* not sure this is strictly needed or simply 
impossible */
-                        static_sampler_state->compare_mode == 
PIPE_TEX_COMPARE_NONE;
+                        static_sampler_state->compare_mode == 
PIPE_TEX_COMPARE_NONE &&
+                        lp_is_simple_wrap_mode(static_sampler_state->wrap_s);
+      if (dims > 1) {
+         use_aos &= lp_is_simple_wrap_mode(static_sampler_state->wrap_t);
+         if (dims > 2) {
+            use_aos &= lp_is_simple_wrap_mode(static_sampler_state->wrap_r);
+         }
+      }
 
       if ((gallivm_debug & GALLIVM_DEBUG_PERF) &&
           !use_aos && util_format_fits_8unorm(bld.format_desc)) {
          debug_printf("%s: using floating point linear filtering for %s\n",
                       __FUNCTION__, bld.format_desc->short_name);
-         debug_printf("  min_img %d  mag_img %d  mip %d  wraps %d  wrapt %d\n",
+         debug_printf("  min_img %d  mag_img %d  mip %d  wraps %d  wrapt %d  
wrapr %d\n",
                       static_sampler_state->min_img_filter,
                       static_sampler_state->mag_img_filter,
                       static_sampler_state->min_mip_filter,
                       static_sampler_state->wrap_s,
-                      static_sampler_state->wrap_t);
+                      static_sampler_state->wrap_t,
+                      static_sampler_state->wrap_r);
       }
 
       lp_build_sample_common(&bld, texture_index, sampler_index,

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to