llvmpipe: Scalar -> vector broadcasting.
This commit is contained in:
@@ -33,6 +33,24 @@
|
||||
#include "lp_bld_swizzle.h"
|
||||
|
||||
|
||||
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,
|
||||
|
||||
@@ -44,6 +44,11 @@ union lp_type type;
|
||||
struct lp_build_context;
|
||||
|
||||
|
||||
LLVMValueRef
|
||||
lp_build_broadcast_scalar(struct lp_build_context *bld,
|
||||
LLVMValueRef scalar);
|
||||
|
||||
|
||||
/**
|
||||
* Broadcast one channel of a vector composed of arrays of XYZW structures into
|
||||
* all four channel.
|
||||
|
||||
Reference in New Issue
Block a user