llvmpipe: Centralize lp_build_context initialization.
This commit is contained in:
parent
b07d19a885
commit
9493260fdc
|
@ -279,11 +279,7 @@ lp_build_blend(LLVMBuilderRef builder,
|
|||
|
||||
/* Setup build context */
|
||||
memset(&bld, 0, sizeof bld);
|
||||
bld.base.builder = builder;
|
||||
bld.base.type = type;
|
||||
bld.base.undef = lp_build_undef(type);
|
||||
bld.base.zero = lp_build_zero(type);
|
||||
bld.base.one = lp_build_one(type);
|
||||
lp_build_context_init(&bld.base, builder, type);
|
||||
bld.src = src;
|
||||
bld.dst = dst;
|
||||
bld.const_ = const_;
|
||||
|
|
|
@ -155,3 +155,16 @@ lp_build_int_vec_type(union lp_type type)
|
|||
LLVMTypeRef elem_type = lp_build_int_elem_type(type);
|
||||
return LLVMVectorType(elem_type, type.length);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
lp_build_context_init(struct lp_build_context *bld,
|
||||
LLVMBuilderRef builder,
|
||||
union lp_type type)
|
||||
{
|
||||
bld->builder = builder;
|
||||
bld->type = type;
|
||||
bld->undef = lp_build_undef(type);
|
||||
bld->zero = lp_build_zero(type);
|
||||
bld->one = lp_build_one(type);
|
||||
}
|
||||
|
|
|
@ -164,4 +164,10 @@ LLVMTypeRef
|
|||
lp_build_int_vec_type(union lp_type type);
|
||||
|
||||
|
||||
void
|
||||
lp_build_context_init(struct lp_build_context *bld,
|
||||
LLVMBuilderRef builder,
|
||||
union lp_type type);
|
||||
|
||||
|
||||
#endif /* !LP_BLD_TYPE_H */
|
||||
|
|
Loading…
Reference in New Issue