[Mesa-dev] [PATCH 2/5] gallivm: pass build context to exec_mask_store.

Dave Airlie airlied at gmail.com
Mon Feb 6 07:46:41 PST 2012


From: Dave Airlie <airlied at redhat.com>

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 <airlied at redhat.com>
---
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c |   14 +++++++++-----
 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 2be4195..eb5176a 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 *bldc,
                                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(bldc,
                                  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;
 
-- 
1.7.7.6



More information about the mesa-dev mailing list