Fix fetching integer inputs.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 17 May 2012 23:55:13 +0000 (00:55 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 17 May 2012 23:55:13 +0000 (00:55 +0100)
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c

index a9d69a3259e59e99a4338f9616c8d7e3c3c4178e..412dc0c622a68222930affd3dc28accb01816db5 100644 (file)
@@ -704,7 +704,15 @@ emit_fetch_input(
          res = bld->inputs[reg->Register.Index][swizzle];
       }
    }
+
    assert(res);
+
+   if (stype == TGSI_TYPE_UNSIGNED) {
+      res = LLVMBuildBitCast(builder, res, bld_base->uint_bld.vec_type, "");
+   } else if (stype == TGSI_TYPE_SIGNED) {
+      res = LLVMBuildBitCast(builder, res, bld_base->int_bld.vec_type, "");
+   }
+
    return res;
 }