summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-02-06 15:28:45 +0000
committerDave Airlie <[email protected]>2012-02-17 17:39:02 +0000
commit66461aa249a95053fd5887df75ab791558c3a486 (patch)
tree92eb41b17618e1eddfe523451d283268e5e7b094 /src/gallium/auxiliary
parentf667a6f3cefbfb33478de87c166f7a52ed388fb4 (diff)
gallivm: add uint/int bld to the base builder. (v2)
These are used inside the action handlers for the integer opcodes. v2: use uint_bld/int_bld, drop higher level uint_bld. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi.h6
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c2
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c13
3 files changed, 12 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
index b03eefc9ee5..a36a09a8fa4 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
@@ -279,6 +279,9 @@ struct lp_build_tgsi_context
{
struct lp_build_context base;
+ struct lp_build_context uint_bld;
+ struct lp_build_context int_bld;
+
/** This array stores functions that are used to transform TGSI opcodes to
* LLVM instructions.
*/
@@ -338,9 +341,6 @@ struct lp_build_tgsi_soa_context
{
struct lp_build_tgsi_context bld_base;
- /* Builder for vector integer masks and indices */
- struct lp_build_context uint_bld;
-
/* Builder for scalar elements of shader's data type (float) */
struct lp_build_context elem_bld;
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c
index 53013f75f2e..2c2c820708a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_aos.c
@@ -991,6 +991,8 @@ lp_build_tgsi_aos(struct gallivm_state *gallivm,
/* Setup build context */
memset(&bld, 0, sizeof bld);
lp_build_context_init(&bld.bld_base.base, gallivm, type);
+ lp_build_context_init(&bld.bld_base.uint_bld, gallivm, lp_uint_type(type));
+ lp_build_context_init(&bld.bld_base.int_bld, gallivm, lp_int_type(type));
lp_build_context_init(&bld.int_bld, gallivm, lp_int_type(type));
for (chan = 0; chan < 4; ++chan) {
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 5578546089a..bc063253bcd 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -485,7 +485,7 @@ get_indirect_index(struct lp_build_tgsi_soa_context *bld,
const struct tgsi_src_register *indirect_reg)
{
LLVMBuilderRef builder = bld->bld_base.base.gallivm->builder;
- struct lp_build_context *uint_bld = &bld->uint_bld;
+ struct lp_build_context *uint_bld = &bld->bld_base.uint_bld;
/* always use X component of address register */
unsigned swizzle = indirect_reg->SwizzleX;
LLVMValueRef base;
@@ -528,7 +528,7 @@ emit_fetch_constant(
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder;
- struct lp_build_context *uint_bld = &bld->uint_bld;
+ struct lp_build_context *uint_bld = &bld_base->uint_bld;
LLVMValueRef indirect_index = NULL;
/* XXX: Handle fetching xyzw components as a vector */
@@ -588,7 +588,7 @@ emit_fetch_input(
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
struct gallivm_state *gallivm = bld->bld_base.base.gallivm;
LLVMBuilderRef builder = gallivm->builder;
- struct lp_build_context *uint_bld = &bld->uint_bld;
+ struct lp_build_context *uint_bld = &bld_base->uint_bld;
LLVMValueRef indirect_index = NULL;
LLVMValueRef res;
@@ -645,7 +645,7 @@ emit_fetch_temporary(
struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);
struct gallivm_state *gallivm = bld->bld_base.base.gallivm;
LLVMBuilderRef builder = gallivm->builder;
- struct lp_build_context *uint_bld = &bld->uint_bld;
+ struct lp_build_context *uint_bld = &bld_base->uint_bld;
LLVMValueRef indirect_index = NULL;
LLVMValueRef res;
@@ -820,7 +820,7 @@ emit_store_chan(
struct gallivm_state *gallivm = bld->bld_base.base.gallivm;
LLVMBuilderRef builder = gallivm->builder;
const struct tgsi_full_dst_register *reg = &inst->Dst[index];
- struct lp_build_context *uint_bld = &bld->uint_bld;
+ struct lp_build_context *uint_bld = &bld_base->uint_bld;
LLVMValueRef indirect_index = NULL;
struct lp_build_context *bld_store;
@@ -1758,7 +1758,8 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
/* Setup build context */
memset(&bld, 0, sizeof bld);
lp_build_context_init(&bld.bld_base.base, gallivm, type);
- lp_build_context_init(&bld.uint_bld, gallivm, lp_uint_type(type));
+ lp_build_context_init(&bld.bld_base.uint_bld, gallivm, lp_uint_type(type));
+ lp_build_context_init(&bld.bld_base.int_bld, gallivm, lp_int_type(type));
lp_build_context_init(&bld.elem_bld, gallivm, lp_elem_type(type));
bld.mask = mask;
bld.pos = pos;