r300/compiler: add handy definitions for XYZ0 and smeared half swizzling
authorMarek Olšák <maraeo@gmail.com>
Fri, 16 Apr 2010 23:31:25 +0000 (01:31 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 16 Apr 2010 23:31:25 +0000 (01:31 +0200)
src/mesa/drivers/dri/r300/compiler/radeon_compiler.c
src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h

index 272f9072d4ae19e53d44d8637717b7558e52c3c7..1c8ba864a41ef518cc0462254cd605206a379daa 100644 (file)
@@ -277,13 +277,13 @@ void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsig
 
        inst_mad->U.I.SrcReg[0].File = RC_FILE_TEMPORARY;
        inst_mad->U.I.SrcReg[0].Index = tempregi;
-       inst_mad->U.I.SrcReg[0].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO);
+       inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZ0;
 
        inst_mad->U.I.SrcReg[1].File = RC_FILE_CONSTANT;
-       inst_mad->U.I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO);
+       inst_mad->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_XYZ0;
 
        inst_mad->U.I.SrcReg[2].File = RC_FILE_CONSTANT;
-       inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO);
+       inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_XYZ0;
 
        if (full_vtransform) {
                inst_mad->U.I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_VIEWPORT_SCALE, 0);
index 7c0d6720b11bd5f7dae5bbd85b0a6b21b766ea7f..842012def02d9e998528f24e6afe58bc0b68a0d9 100644 (file)
@@ -114,12 +114,14 @@ typedef enum {
        } while(0)
 
 #define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W)
+#define RC_SWIZZLE_XYZ0 RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO)
 #define RC_SWIZZLE_XXXX RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_X)
 #define RC_SWIZZLE_YYYY RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Y)
 #define RC_SWIZZLE_ZZZZ RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Z)
 #define RC_SWIZZLE_WWWW RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_W)
 #define RC_SWIZZLE_0000 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ZERO)
 #define RC_SWIZZLE_1111 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ONE)
+#define RC_SWIZZLE_HHHH RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_HALF)
 
 /**
  * \name Bitmasks for components of vectors.