summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_swizzle.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-11 13:09:54 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:29 +0100
commit4393ca7956bd03e07b4d7a019705fc62d4ac7155 (patch)
tree0427cf5d3b6141966e887e50254f904da96de134 /src/gallium/drivers/llvmpipe/lp_bld_swizzle.c
parent8422f293ab7bf1ff1adf105ed3240b1627538d34 (diff)
llvmpipe: Scalar -> vector broadcasting.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_swizzle.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_swizzle.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_swizzle.c b/src/gallium/drivers/llvmpipe/lp_bld_swizzle.c
index 1f83bf6782..3182573db2 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_swizzle.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_swizzle.c
@@ -34,6 +34,24 @@
LLVMValueRef
+lp_build_broadcast_scalar(struct lp_build_context *bld,
+ LLVMValueRef scalar)
+{
+ const union lp_type type = bld->type;
+ LLVMValueRef res;
+ unsigned i;
+
+ res = bld->undef;
+ for(i = 0; i < type.length; ++i) {
+ LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), i, 0);
+ res = LLVMBuildInsertElement(bld->builder, res, scalar, index, "");
+ }
+
+ return res;
+}
+
+
+LLVMValueRef
lp_build_broadcast_aos(struct lp_build_context *bld,
LLVMValueRef a,
unsigned channel)