summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2012-12-04 16:54:41 +0000
committerJosé Fonseca <jfonseca@vmware.com>2012-12-07 15:03:07 +0000
commit3b7ce726258de20be2d65f7b9f51b160dd99638a (patch)
tree6f5993dda31bc43684303243da591514553abe79 /src/gallium/auxiliary
parent1d35f77228ad540a551a8e09e062b764a6e31f5e (diff)
downloadexternal_mesa3d-3b7ce726258de20be2d65f7b9f51b160dd99638a.zip
external_mesa3d-3b7ce726258de20be2d65f7b9f51b160dd99638a.tar.gz
external_mesa3d-3b7ce726258de20be2d65f7b9f51b160dd99638a.tar.bz2
gallivm: Allow indirection from TEMP registers too.
The ADDR file is cumbersome for native integer capable drivers. We should consider deprecating it eventually, but this just adds support for indirection from TEMP registers. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 9caac21..fbeb805 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -533,9 +533,24 @@ get_indirect_index(struct lp_build_tgsi_soa_context *bld,
base = lp_build_const_int_vec(bld->bld_base.base.gallivm, uint_bld->type, reg_index);
assert(swizzle < 4);
- rel = LLVMBuildLoad(builder,
- bld->addr[indirect_reg->Index][swizzle],
- "load addr reg");
+ switch (indirect_reg->File) {
+ case TGSI_FILE_ADDRESS:
+ rel = LLVMBuildLoad(builder,
+ bld->addr[indirect_reg->Index][swizzle],
+ "load addr reg");
+ /* ADDR LLVM values already have LLVM integer type. */
+ break;
+ case TGSI_FILE_TEMPORARY:
+ rel = lp_get_temp_ptr_soa(bld, indirect_reg->Index, swizzle);
+ rel = LLVMBuildLoad(builder, rel, "load temp reg");
+ /* TEMP LLVM values always have LLVM float type, but for indirection, the
+ * value actually stored is expected to be an integer */
+ rel = LLVMBuildBitCast(builder, rel, uint_bld->vec_type, "");
+ break;
+ default:
+ assert(0);
+ rel = uint_bld->zero;
+ }
index = lp_build_add(uint_bld, base, rel);