From 5d04101d18270eec1692e691b1a4321a0ee3fb10 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 29 Oct 2005 18:29:54 +0000 Subject: [PATCH] added some assertions to catch unexpected swizzle values in cvp_emit_arg(), currently fails sometimes --- src/mesa/tnl/t_vb_arbprogram.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 14011f43db0..3212e00195a 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -790,6 +790,13 @@ static struct reg cvp_emit_arg( struct compilation *cp, */ rsw.dword = 0; rsw.rsw.neg = src->Negate ? WRITEMASK_XYZW : 0; + + /* we're expecting 2-bit swizzles below... */ + ASSERT(GET_SWZ(src->Swizzle, 0) < 4); + ASSERT(GET_SWZ(src->Swizzle, 1) < 4); + ASSERT(GET_SWZ(src->Swizzle, 2) < 4); + ASSERT(GET_SWZ(src->Swizzle, 3) < 4); + rsw.rsw.swz = ((GET_SWZ(src->Swizzle, 0) << 0) | (GET_SWZ(src->Swizzle, 1) << 2) | (GET_SWZ(src->Swizzle, 2) << 4) | -- 2.30.2