aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-07-26 08:58:05 +0200
committermarha <marha@users.sourceforge.net>2011-07-26 08:58:05 +0200
commitece07bdeaa82ea59e74bcfc588bcabe5e47567c1 (patch)
tree661e19ae13980e19f6fe827be5322ca9e0f8e4d8 /mesalib/src/mesa/program/ir_to_mesa.cpp
parent91e91b72f07f4e61db17ee86c6933a7217f0e25c (diff)
downloadvcxsrv-ece07bdeaa82ea59e74bcfc588bcabe5e47567c1.tar.gz
vcxsrv-ece07bdeaa82ea59e74bcfc588bcabe5e47567c1.tar.bz2
vcxsrv-ece07bdeaa82ea59e74bcfc588bcabe5e47567c1.zip
libX11 libXext mesa pixman xserver xkeyboard-config git update 26 July 2011
Diffstat (limited to 'mesalib/src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--mesalib/src/mesa/program/ir_to_mesa.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp
index 738e97ca5..8b4a535b7 100644
--- a/mesalib/src/mesa/program/ir_to_mesa.cpp
+++ b/mesalib/src/mesa/program/ir_to_mesa.cpp
@@ -134,7 +134,7 @@ src_reg::src_reg(dst_reg reg)
this->index = reg.index;
this->swizzle = SWIZZLE_XYZW;
this->negate = 0;
- this->reladdr = NULL;
+ this->reladdr = reg.reladdr;
}
dst_reg::dst_reg(src_reg reg)
@@ -1415,9 +1415,9 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
case ir_var_in:
case ir_var_inout:
/* The linker assigns locations for varyings and attributes,
- * including deprecated builtins (like gl_Color), user-assign
- * generic attributes (glBindVertexLocation), and
- * user-defined varyings.
+ * including deprecated builtins (like gl_Color),
+ * user-assigned generic attributes (glBindVertexLocation),
+ * and user-defined varyings.
*
* FINISHME: We would hit this path for function arguments. Fix!
*/
@@ -1496,6 +1496,18 @@ ir_to_mesa_visitor::visit(ir_dereference_array *ir)
this->result, 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) {
+ src_reg accum_reg = get_temp(glsl_type::float_type);
+
+ emit(ir, OPCODE_ADD, dst_reg(accum_reg),
+ index_reg, *src.reladdr);
+
+ index_reg = accum_reg;
+ }
+
src.reladdr = ralloc(mem_ctx, src_reg);
memcpy(src.reladdr, &index_reg, sizeof(index_reg));
}