radeonsi: partially revert "switch descriptors to i32 vectors"
authorMarek Olšák <marek.olsak@amd.com>
Mon, 14 Jul 2014 17:40:14 +0000 (19:40 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 14 Jul 2014 19:40:19 +0000 (21:40 +0200)
It indeed breaks LLVM 3.4.2.

src/gallium/drivers/radeonsi/si_shader.c

index 9ff08a59dfaebf2152b2aaab0b63a1b16d9d24b3..563365b48e87ede59e2a38a659a24995ec49f699 100644 (file)
@@ -1989,6 +1989,7 @@ static void build_tex_intrinsic(const struct lp_build_tgsi_action * action,
                        emit_data->args, emit_data->arg_count,
                        LLVMReadNoneAttribute | LLVMNoUnwindAttribute);
        } else {
+               LLVMTypeRef i8, v16i8, v32i8;
                const char *name;
 
                switch (opcode) {
@@ -2016,6 +2017,17 @@ static void build_tex_intrinsic(const struct lp_build_tgsi_action * action,
                        return;
                }
 
+               i8 = LLVMInt8TypeInContext(base->gallivm->context);
+               v16i8 = LLVMVectorType(i8, 16);
+               v32i8 = LLVMVectorType(i8, 32);
+
+               emit_data->args[1] = LLVMBuildBitCast(base->gallivm->builder,
+                                               emit_data->args[1], v32i8, "");
+               if (opcode != TGSI_OPCODE_TXF) {
+                       emit_data->args[2] = LLVMBuildBitCast(base->gallivm->builder,
+                                               emit_data->args[2], v16i8, "");
+               }
+
                sprintf(intr_name, "%s.v%ui32", name,
                        LLVMGetVectorSize(LLVMTypeOf(emit_data->args[0])));