summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-11-05 08:49:53 -0600
committerBrian Paul <brianp@vmware.com>2010-11-05 08:49:57 -0600
commite8d6b2793ff3907d3646eeaceaa00e2a04728e67 (patch)
tree194b9732835ccf8c9b0d824eb630cd98d895c2e5 /src/gallium/auxiliary/gallivm
parent3168c6ff1a239d089180be77a5774b566aade1e9 (diff)
gallivm: alloca() was called too often for temporary arrays
Need to increment the array index to point to the last value. Before, we were calling lp_build_array_alloca() over and over for no reason.
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index a74cefd41e..897b09ff22 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1189,10 +1189,12 @@ emit_declaration(
case TGSI_FILE_TEMPORARY:
assert(idx < LP_MAX_TGSI_TEMPS);
if (bld->indirect_files & (1 << TGSI_FILE_TEMPORARY)) {
+ /* ignore 'first' - we want to index into a 0-based array */
LLVMValueRef array_size = LLVMConstInt(LLVMInt32Type(),
last*4 + 4, 0);
bld->temps_array = lp_build_array_alloca(bld->base.builder,
vec_type, array_size, "temparray");
+ idx = last;
} else {
for (i = 0; i < NUM_CHANNELS; i++)
bld->temps[idx][i] = lp_build_alloca(bld->base.builder,