projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10d31cb
)
glsl_to_tgsi: add each relative address to the previous
author
Bryan Cain
<bryancain3@gmail.com>
Wed, 27 Jul 2011 21:36:10 +0000
(16:36 -0500)
committer
Bryan Cain
<bryancain3@gmail.com>
Mon, 1 Aug 2011 22:59:10 +0000
(17:59 -0500)
This is a glsl_to_tgsi port of commit
d6e1a8f71437
.
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
patch
|
blob
|
history
diff --git
a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 0cbfc943a05d5c4af5f0422c5e3242dd0248ec70..f66e240a1773dc12795655c48a231adf60980a0a 100644
(file)
--- a/
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@
-1741,6
+1741,18
@@
glsl_to_tgsi_visitor::visit(ir_dereference_array *ir)
this->result, st_src_reg_for_float(element_size));
}
+ /* If there was already a relative address register involved, add the
+ * new and the old together to get the new offset.
+ */
+ if (src.reladdr != NULL) {
+ st_src_reg accum_reg = get_temp(glsl_type::float_type);
+
+ emit(ir, TGSI_OPCODE_ADD, st_dst_reg(accum_reg),
+ index_reg, *src.reladdr);
+
+ index_reg = accum_reg;
+ }
+
src.reladdr = ralloc(mem_ctx, st_src_reg);
memcpy(src.reladdr, &index_reg, sizeof(index_reg));
}