gallium/aux: Use TGSI chan name defines inplace of literals
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>
Thu, 7 Jan 2016 16:44:45 +0000 (03:44 +1100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 8 Jan 2016 17:18:24 +0000 (12:18 -0500)
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/tgsi/tgsi_util.c

index 653e650dc4c6fd10fb513eb3f1e58a341e62effa..5fff3f0787f5b6a4bfcd9ae0a7c9ad1fcdf4b835 100644 (file)
@@ -29,6 +29,7 @@
 #include "pipe/p_shader_tokens.h"
 #include "tgsi_parse.h"
 #include "tgsi_util.h"
+#include "tgsi_exec.h"
 
 union pointer_hack
 {
@@ -53,17 +54,17 @@ tgsi_util_get_src_register_swizzle(
    const struct tgsi_src_register *reg,
    unsigned component )
 {
-   switch( component ) {
-   case 0:
+   switch (component) {
+   case TGSI_CHAN_X:
       return reg->SwizzleX;
-   case 1:
+   case TGSI_CHAN_Y:
       return reg->SwizzleY;
-   case 2:
+   case TGSI_CHAN_Z:
       return reg->SwizzleZ;
-   case 3:
+   case TGSI_CHAN_W:
       return reg->SwizzleW;
    default:
-      assert( 0 );
+      assert(0);
    }
    return 0;
 }