gallivm: silence uninitialized var warning
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_tgsi_soa.c
index 1622eda5c872b7eee570ec9fcf443e3a1bd85e47..aaf3360aa245b4b974496e986420036388f9f215 100644 (file)
@@ -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: