llvmpipe: Centralize lp_build_context initialization.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 8 Aug 2009 21:49:23 +0000 (22:49 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:21:25 +0000 (09:21 +0100)
src/gallium/drivers/llvmpipe/lp_bld_blend.c
src/gallium/drivers/llvmpipe/lp_bld_type.c
src/gallium/drivers/llvmpipe/lp_bld_type.h

index e070aac378df334049fe4ec2565746ff95e32235..a144469b354448b31eb74a5d63f9477577f540b8 100644 (file)
@@ -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_;
index 1e95a1a349d90bffec6b737ebc9da65c59ce8927..fd6ff99e2e6f2c3703fbf3dd8dd0578e853aecd7 100644 (file)
@@ -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);
+}
index 37d6885049ccf0e2b6775b1e7287b1ca765ac3b6..c56dd3b20e856bac0eba7496b4c6fb06a50fe714 100644 (file)
@@ -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 */