summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-02-06 13:35:46 +0000
committerDave Airlie <[email protected]>2012-02-17 17:39:01 +0000
commit639fbe2e75bb23a72262a7bc60d69d026b649609 (patch)
tree92fc59ba6fe7a2436e50d2f17fcdca688905ee7a /src/gallium
parent13e2e51f7058dff01281050db1b64639ad3b399e (diff)
gallivm: pass build context to exec_mask_store.
For now just pass the current context, but when we want to store int or unsigned we need to pass those later. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 2be41950853..62a938eeefd 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -268,6 +268,7 @@ static void lp_exec_endloop(struct gallivm_state *gallivm,
* (0 means don't store this bit, 1 means do store).
*/
static void lp_exec_mask_store(struct lp_exec_mask *mask,
+ struct lp_build_context *bld_store,
LLVMValueRef pred,
LLVMValueRef val,
LLVMValueRef dst)
@@ -287,7 +288,7 @@ static void lp_exec_mask_store(struct lp_exec_mask *mask,
LLVMValueRef real_val, dst_val;
dst_val = LLVMBuildLoad(builder, dst, "");
- real_val = lp_build_select(mask->bld,
+ real_val = lp_build_select(bld_store,
pred,
val, dst_val);
@@ -821,6 +822,9 @@ emit_store_chan(
const struct tgsi_full_dst_register *reg = &inst->Dst[index];
struct lp_build_context *uint_bld = &bld->uint_bld;
LLVMValueRef indirect_index = NULL;
+ struct lp_build_context *bld_store;
+
+ bld_store = &bld->bld_base.base;
switch( inst->Instruction.Saturate ) {
case TGSI_SAT_NONE:
@@ -889,7 +893,7 @@ emit_store_chan(
else {
LLVMValueRef out_ptr = lp_get_output_ptr(bld, reg->Register.Index,
chan_index);
- lp_exec_mask_store(&bld->exec_mask, pred, value, out_ptr);
+ lp_exec_mask_store(&bld->exec_mask, bld_store, pred, value, out_ptr);
}
break;
@@ -932,17 +936,17 @@ emit_store_chan(
else {
LLVMValueRef temp_ptr = lp_get_temp_ptr_soa(bld, reg->Register.Index,
chan_index);
- lp_exec_mask_store(&bld->exec_mask, pred, value, temp_ptr);
+ lp_exec_mask_store(&bld->exec_mask, bld_store, pred, value, temp_ptr);
}
break;
case TGSI_FILE_ADDRESS:
- lp_exec_mask_store(&bld->exec_mask, pred, value,
+ lp_exec_mask_store(&bld->exec_mask, bld_store, pred, value,
bld->addr[reg->Register.Index][chan_index]);
break;
case TGSI_FILE_PREDICATE:
- lp_exec_mask_store(&bld->exec_mask, pred, value,
+ lp_exec_mask_store(&bld->exec_mask, bld_store, pred, value,
bld->preds[reg->Register.Index][chan_index]);
break;