<p dir="ltr">This makes the code identical to the new code I added in suq handling? If so, r-b. As a separate patch, I'd encourage a refactor of the logic.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Jul 4, 2016 6:08 PM, "Samuel Pitoiset" <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In presence of an indirect image access, the base offset should be<br>
zeroed because the stride will be computed twice. This is a pretty<br>
rare situation but it can happen when tex.r > 0.<br>
<br>
Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>><br>
Cc: "11.2 12.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
---<br>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 6 ++++--<br>
1 file changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp<br>
index ce0f99c..ec349ec 100644<br>
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp<br>
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp<br>
@@ -1685,7 +1685,7 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su)<br>
const int idx = su->tex.r;<br>
const int dim = su->tex.target.getDim();<br>
const int arg = dim + (su->tex.target.isArray() || su->tex.target.isCube());<br>
- const uint16_t base = idx * NVE4_SU_INFO__STRIDE;<br>
+ uint16_t base = idx * NVE4_SU_INFO__STRIDE;<br>
int c;<br>
Value *zero = bld.mkImm(0);<br>
Value *p1 = NULL;<br>
@@ -1712,6 +1712,7 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su)<br>
}<br>
ind = bld.mkOp2v(OP_AND, TYPE_U32, bld.getSSA(), ind, bld.mkImm(7));<br>
ind = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(), ind, bld.mkImm(6));<br>
+ base = 0;<br>
}<br>
<br>
// calculate clamped coordinates<br>
@@ -2049,7 +2050,7 @@ NVC0LoweringPass::processSurfaceCoordsNVC0(TexInstruction *su)<br>
const int idx = su->tex.r;<br>
const int dim = su->tex.target.getDim();<br>
const int arg = dim + (su->tex.target.isArray() || su->tex.target.isCube());<br>
- const uint16_t base = idx * NVE4_SU_INFO__STRIDE;<br>
+ uint16_t base = idx * NVE4_SU_INFO__STRIDE;<br>
int c;<br>
Value *zero = bld.mkImm(0);<br>
Value *src[3];<br>
@@ -2068,6 +2069,7 @@ NVC0LoweringPass::processSurfaceCoordsNVC0(TexInstruction *su)<br>
}<br>
ind = bld.mkOp2v(OP_AND, TYPE_U32, bld.getSSA(), ind, bld.mkImm(7));<br>
ind = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(), ind, bld.mkImm(6));<br>
+ base = 0;<br>
}<br>
<br>
// get surface coordinates<br>
--<br>
2.9.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>