cell: implement swizzling for src regs
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 12 Sep 2008 14:48:08 +0000 (08:48 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 12 Sep 2008 14:48:08 +0000 (08:48 -0600)
src/gallium/drivers/cell/ppu/cell_gen_fp.c

index 6ffe94eb14a005268e9715874d097547a4e372a7..d7a8846ab3aedc24b02a93860ba52931aecdb312 100644 (file)
@@ -137,11 +137,12 @@ get_src_reg(struct codegen *gen,
             const struct tgsi_full_src_register *src)
 {
    int reg;
+   int swizzle = tgsi_util_get_full_src_register_extswizzle(src, channel);
 
-   /* XXX need to examine src swizzle info here.
-    * That will involve changing the channel var...
-    */
+   assert(swizzle >= 0);
+   assert(swizzle <= 3);
 
+   channel = swizzle;
 
    switch (src->SrcRegister.File) {
    case TGSI_FILE_TEMPORARY: