added some assertions to catch unexpected swizzle values in cvp_emit_arg(), currently...
authorBrian Paul <brian.paul@tungstengraphics.com>
Sat, 29 Oct 2005 18:29:54 +0000 (18:29 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sat, 29 Oct 2005 18:29:54 +0000 (18:29 +0000)
src/mesa/tnl/t_vb_arbprogram.c

index 14011f43db07f51fd0b557aad57da5c47da23a9b..3212e00195a73e83bd0b4b876f576aca7bb7f88e 100644 (file)
@@ -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) |