r300: fix swizzle masking in getUsedComponents

This commit is contained in:
Maciej Cencora
2009-07-11 19:10:58 +02:00
parent acd3360041
commit 3f5382819e
+8 -4
View File
@@ -1524,10 +1524,14 @@ static GLuint getUsedComponents(const GLuint swizzle)
ret = 0;
/* need to mask out ZERO, ONE and NIL swizzles */
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_X) & 0x3);
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_Y) & 0x3);
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_Z) & 0x3);
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_W) & 0x3);
if (GET_SWZ(swizzle, SWIZZLE_X) <= SWIZZLE_W)
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_X));
if (GET_SWZ(swizzle, SWIZZLE_Y) <= SWIZZLE_W)
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_Y));
if (GET_SWZ(swizzle, SWIZZLE_Z) <= SWIZZLE_W)
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_Z));
if (GET_SWZ(swizzle, SWIZZLE_W) <= SWIZZLE_W)
ret |= 1 << (GET_SWZ(swizzle, SWIZZLE_W));
return ret;
}