Mesa (master): softpipe: don' t assert on illegal wrap mode for rect textures

Roland Scheidegger sroland at kemper.freedesktop.org
Fri Aug 29 23:18:04 UTC 2014


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

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Thu Aug 28 00:43:32 2014 +0200

softpipe: don't assert on illegal wrap mode for rect textures

piglit tex-miplevel-selection nowadays doesn't use repeat wrap mode due to
sampler objects any longer, however at the time of the clear the wrap mode
is still illegal and at this point we get to verify the state, including
samplers (even though they won't get used), and because mesa doesn't treat
it as an incomplete texture as the spec says it should, we hit the assertion.
Just warn about this for now instead.
Gets crashes down from 44 to 14 in a piglit run (all were in various tests of
tex-miplevel-selection with texture rectangles). Though just about all
tex-miplevel-selection tests fail anyway for other reasons.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/gallium/drivers/softpipe/sp_tex_sample.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index 2d59766..91f2701 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -2586,7 +2586,7 @@ get_nearest_unorm_wrap(unsigned mode)
    case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
       return wrap_nearest_unorm_clamp_to_border;
    default:
-      assert(0);
+      debug_printf("illegal wrap mode %d with non-normalized coords\n", mode);
       return wrap_nearest_unorm_clamp;
    }
 }
@@ -2630,7 +2630,7 @@ get_linear_unorm_wrap(unsigned mode)
    case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
       return wrap_linear_unorm_clamp_to_border;
    default:
-      assert(0);
+      debug_printf("illegal wrap mode %d with non-normalized coords\n", mode);
       return wrap_linear_unorm_clamp;
    }
 }




More information about the mesa-commit mailing list