gallivm: silence uninitialized var warning
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_tgsi_soa.c
index 9e7246902c62f47bd904cdb1733b6c0c98f42f2c..aaf3360aa245b4b974496e986420036388f9f215 100644 (file)
@@ -120,7 +120,7 @@ struct lp_build_tgsi_soa_context
    const LLVMValueRef (*inputs)[NUM_CHANNELS];
    LLVMValueRef (*outputs)[NUM_CHANNELS];
 
-   struct lp_build_sampler_soa *sampler;
+   const struct lp_build_sampler_soa *sampler;
 
    LLVMValueRef immediates[LP_MAX_TGSI_IMMEDIATES][NUM_CHANNELS];
    LLVMValueRef temps[LP_MAX_TGSI_TEMPS][NUM_CHANNELS];
@@ -349,7 +349,7 @@ static void lp_exec_mask_store(struct lp_exec_mask *mask,
    /* Mix the predicate and execution mask */
    if (mask->has_mask) {
       if (pred) {
-         LLVMBuildAnd(mask->bld->builder, pred, mask->exec_mask, "");
+         pred = LLVMBuildAnd(mask->bld->builder, pred, mask->exec_mask, "");
       } else {
          pred = mask->exec_mask;
       }
@@ -391,15 +391,16 @@ emit_ddy(struct lp_build_tgsi_soa_context *bld,
 static LLVMValueRef
 get_temp_ptr(struct lp_build_tgsi_soa_context *bld,
              unsigned index,
-             unsigned swizzle,
+             unsigned chan,
              boolean is_indirect,
              LLVMValueRef addr)
 {
+   assert(chan < 4);
    if (!bld->has_indirect_addressing) {
-      return bld->temps[index][swizzle];
+      return bld->temps[index][chan];
    } else {
       LLVMValueRef lindex =
-         LLVMConstInt(LLVMInt32Type(), index*4 + swizzle, 0);
+         LLVMConstInt(LLVMInt32Type(), index * 4 + chan, 0);
       if (is_indirect)
          lindex = lp_build_add(&bld->base, lindex, addr);
       return LLVMBuildGEP(bld->base.builder, bld->temps_array, &lindex, 1, "");
@@ -419,7 +420,7 @@ emit_fetch(
    const struct tgsi_full_src_register *reg = &inst->Src[index];
    unsigned swizzle = tgsi_util_get_full_src_register_swizzle( reg, chan_index );
    LLVMValueRef res;
-   LLVMValueRef addr;
+   LLVMValueRef addr = NULL;
 
    switch (swizzle) {
    case TGSI_SWIZZLE_X:
@@ -624,7 +625,7 @@ emit_store(
    LLVMValueRef value)
 {
    const struct tgsi_full_dst_register *reg = &inst->Dst[index];
-   LLVMValueRef addr;
+   LLVMValueRef addr = NULL;
 
    switch( inst->Instruction.Saturate ) {
    case TGSI_SAT_NONE:
@@ -1882,7 +1883,7 @@ lp_build_tgsi_soa(LLVMBuilderRef builder,
                   const LLVMValueRef (*inputs)[NUM_CHANNELS],
                   LLVMValueRef (*outputs)[NUM_CHANNELS],
                   struct lp_build_sampler_soa *sampler,
-                  struct tgsi_shader_info *info)
+                  const struct tgsi_shader_info *info)
 {
    struct lp_build_tgsi_soa_context bld;
    struct tgsi_parse_context parse;