tgsi: Add assertions to the new rule that when an extended swizzle
authorMichal Krol <michal@tungstengraphics.com>
Mon, 2 Jun 2008 09:59:04 +0000 (11:59 +0200)
committerMichal Krol <michal@tungstengraphics.com>
Mon, 2 Jun 2008 09:59:04 +0000 (11:59 +0200)
is used, the simple swizzle must be set to identity.

src/gallium/auxiliary/tgsi/util/tgsi_build.c

index 63cc27becc013a82766b83cf2c05b3bd545b1116..18e44b38c2476bc16441a1c4b2c74fcfb6709a40 100644 (file)
@@ -628,6 +628,14 @@ tgsi_build_full_instruction(
             tgsi_default_src_register_ext_swz() ) ) {
          struct tgsi_src_register_ext_swz *src_register_ext_swz;
 
+         /* Use of the extended swizzle requires the simple swizzle to be identity.
+          */
+         assert( reg->SrcRegister.SwizzleX == TGSI_SWIZZLE_X );
+         assert( reg->SrcRegister.SwizzleY == TGSI_SWIZZLE_Y );
+         assert( reg->SrcRegister.SwizzleZ == TGSI_SWIZZLE_Z );
+         assert( reg->SrcRegister.SwizzleW == TGSI_SWIZZLE_W );
+         assert( reg->SrcRegister.Negate == FALSE );
+
          if( maxsize <= size )
             return 0;
          src_register_ext_swz =