summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-07-12 10:41:39 -0400
committerTom Stellard <[email protected]>2012-07-12 13:53:22 -0400
commitf92873be2c7fcb07154282bd0e418a4c88b6507e (patch)
tree92d0823b2cb2ea70e20bb955f2482fa974c47fd4 /src
parent185fc9a5efc85d8eadf14d38399e43efea3388d0 (diff)
radeon/llvm: Don't use lp_build_swizzle_aos() for swizzles
This function assumes that lp_build_context::type is a vector type, which is not true for r600 or radeonsi. This fixes an assertion failure using glamor 2D accel.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index 9c2c449db65..641d27745c3 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -65,14 +65,19 @@ static LLVMValueRef emit_swizzle(
unsigned swizzle_z,
unsigned swizzle_w)
{
- unsigned char swizzles[4];
- swizzles[0] = swizzle_x;
- swizzles[1] = swizzle_y;
- swizzles[2] = swizzle_z;
- swizzles[3] = swizzle_w;
-
-
- return lp_build_swizzle_aos(&bld_base->base, value, swizzles);
+ LLVMValueRef swizzles[4];
+ LLVMTypeRef i32t =
+ LLVMInt32TypeInContext(bld_base->base.gallivm->context);
+
+ swizzles[0] = LLVMConstInt(i32t, swizzle_x, 0);
+ swizzles[1] = LLVMConstInt(i32t, swizzle_y, 0);
+ swizzles[2] = LLVMConstInt(i32t, swizzle_z, 0);
+ swizzles[3] = LLVMConstInt(i32t, swizzle_w, 0);
+
+ return LLVMBuildShuffleVector(bld_base->base.gallivm->builder,
+ value,
+ LLVMGetUndef(LLVMTypeOf(value)),
+ LLVMConstVector(swizzles, 4), "");
}
static LLVMValueRef