summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-08 22:49:23 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:25 +0100
commit9493260fdcef4a8238b9d9a9dc3e753dd89810fe (patch)
tree812536c80dfb3b14d10b058d236ecb550241a0f7 /src
parentb07d19a8859efb930d837c3b324be94cf412d819 (diff)
downloadexternal_mesa3d-9493260fdcef4a8238b9d9a9dc3e753dd89810fe.zip
external_mesa3d-9493260fdcef4a8238b9d9a9dc3e753dd89810fe.tar.gz
external_mesa3d-9493260fdcef4a8238b9d9a9dc3e753dd89810fe.tar.bz2
llvmpipe: Centralize lp_build_context initialization.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_blend.c6
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_type.c13
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_type.h6
3 files changed, 20 insertions, 5 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend.c b/src/gallium/drivers/llvmpipe/lp_bld_blend.c
index e070aac..a144469 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_blend.c
@@ -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_;
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_type.c b/src/gallium/drivers/llvmpipe/lp_bld_type.c
index 1e95a1a..fd6ff99 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_type.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_type.c
@@ -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);
+}
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_type.h b/src/gallium/drivers/llvmpipe/lp_bld_type.h
index 37d6885..c56dd3b 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_type.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_type.h
@@ -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 */