Fixing swizzle.

This commit is contained in:
Ben Vanik 2013-12-14 15:47:32 -08:00
parent 1fb8650f6d
commit 52ff9bdfd0
1 changed files with 9 additions and 4 deletions

View File

@ -51,11 +51,16 @@ enum ArithmeticFlags {
enum Permutes { enum Permutes {
PERMUTE_XY_ZW = 0x00010405, PERMUTE_XY_ZW = 0x00010405,
}; };
#define SWIZZLE_MASK(x, y, z, w) ( \
(((x) & 0x3) << 6) | \
(((y) & 0x3) << 4) | \
(((z) & 0x3) << 2) | \
(((w) & 0x3)))
enum Swizzles { enum Swizzles {
SWIZZLE_XYZW_TO_XYZW = 0xE4, SWIZZLE_XYZW_TO_XYZW = SWIZZLE_MASK(0, 1, 2, 3),
SWIZZLE_XYZW_TO_YZWX = 0x39, SWIZZLE_XYZW_TO_YZWX = SWIZZLE_MASK(1, 2, 3, 0),
SWIZZLE_XYZW_TO_ZWXY = 0x4E, SWIZZLE_XYZW_TO_ZWXY = SWIZZLE_MASK(2, 3, 0, 1),
SWIZZLE_XYZW_TO_WXYZ = 0x93, SWIZZLE_XYZW_TO_WXYZ = SWIZZLE_MASK(3, 0, 1, 2),
}; };