iris: Don't enable smooth points when point sprites are enabled
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_tgsi.c
index 079a6eed4963f5a6046d368defac34ef347038ed..2c3be8fb1275ae91f3f4c84e20bd57f7248af904 100644 (file)
@@ -198,7 +198,7 @@ void lp_build_fetch_args(
  *    - map dst x,z to src xy;
  *    - map dst y,w to src zw;
  */
-static int get_src_chan_idx(unsigned opcode,
+static int get_src_chan_idx(enum tgsi_opcode opcode,
                             int dst_chan_index)
 {
    enum tgsi_opcode_type dtype = tgsi_opcode_infer_dst_type(opcode, 0);
@@ -232,10 +232,10 @@ lp_build_tgsi_inst_llvm(
    struct lp_build_tgsi_context * bld_base,
    const struct tgsi_full_instruction * inst)
 {
-   unsigned tgsi_opcode = inst->Instruction.Opcode;
-   const struct tgsi_opcode_info * info = tgsi_get_opcode_info(tgsi_opcode);
+   enum tgsi_opcode opcode = inst->Instruction.Opcode;
+   const struct tgsi_opcode_info * info = tgsi_get_opcode_info(opcode);
    const struct lp_build_tgsi_action * action =
-                                         &bld_base->op_actions[tgsi_opcode];
+                                         &bld_base->op_actions[opcode];
    struct lp_build_emit_data emit_data;
    unsigned chan_index;
    LLVMValueRef val;
@@ -353,6 +353,15 @@ lp_build_emit_fetch_src(
          assert(0 && "invalid swizzle in emit_fetch()");
          return bld_base->base.undef;
       }
+      if (tgsi_type_is_64bit(stype)) {
+        unsigned swizzle2;
+        swizzle2 = tgsi_util_get_full_src_register_swizzle(reg, chan_index + 1);
+        if (swizzle2 > 3) {
+           assert(0 && "invalid swizzle in emit_fetch()");
+           return bld_base->base.undef;
+        }
+        swizzle |= (swizzle2 << 16);
+      }
    }
 
    assert(reg->Register.Index <= bld_base->info->file_max[reg->Register.File]);