summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 6cc72ff948d..853de09cc6b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1084,6 +1084,15 @@ emit_store_chan(
break;
}
+ /* If the destination is untyped then the source can be anything,
+ * but LLVM won't like if the types don't match so lets cast
+ * to the correct destination type as expected by LLVM. */
+ if (dtype == TGSI_TYPE_UNTYPED &&
+ !lp_check_vec_type(bld_store->type, LLVMTypeOf(value))) {
+ value = LLVMBuildBitCast(builder, value, bld_store->vec_type,
+ "src_casted");
+ }
+
switch( inst->Instruction.Saturate ) {
case TGSI_SAT_NONE:
break;