<div dir="ltr">Hi Sergii,<div><br></div><div>I built this into mesa 17.3.7 and it seems to solve all the issues I've seen that were mentioned in 101408.</div><div><br></div><div>This includes not just the issues with the Mortar, but the other visual artefacts that I've noticed with the player models and with other weapons in the game.</div><div><br></div><div>Many thanks for digging into this.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 26 March 2018 at 23:22, Sergii Romantsov <span dir="ltr"><<a href="mailto:sergii.romantsov@globallogic.com" target="_blank">sergii.romantsov@globallogic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello, Stuart.<div>Could You, please, test this patch?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 26, 2018 at 3:16 PM, Sergii Romantsov <span dir="ltr"><<a href="mailto:sergii.romantsov@gmail.com" target="_blank">sergii.romantsov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Negative deltas are used to fake a range in a large buffer.<br>
See 900a5c91eeb3<br>
"i965: Use negative relocation deltas to minimise vertex uploads"<br>
<br>
Gen8+ use 48-bit address relocations so need to extend the sign<br>
to 64-bit return value. Without it we have higher bits zeroed<br>
and missing the negavive values.<br>
Haswell and older use 32-bit deltas so are unaffected by this issue.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=101408" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/s<wbr>how_bug.cgi?id=101408</a><br>
Signed-off-by: Sergii Romantsov <<a href="mailto:sergii.romantsov@globallogic.com" target="_blank">sergii.romantsov@globallogic.<wbr>com</a>><br>
Tested-by: Andriy Khulap <<a href="mailto:andriy.khulap@globallogic.com" target="_blank">andriy.khulap@globallogic.com</a><wbr>><br>
---<br>
 src/mesa/drivers/dri/i965/int<wbr>el_batchbuffer.c | 4 +++-<br>
 1 file changed, 3 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/in<wbr>tel_batchbuffer.c b/src/mesa/drivers/dri/i965/in<wbr>tel_batchbuffer.c<br>
index d824ff2..128da77 100644<br>
--- a/src/mesa/drivers/dri/i965/in<wbr>tel_batchbuffer.c<br>
+++ b/src/mesa/drivers/dri/i965/in<wbr>tel_batchbuffer.c<br>
@@ -1124,8 +1124,10 @@ emit_reloc(struct intel_batchbuffer *batch,<br>
    /* Using the old buffer offset, write in what the right data would be, in<br>
     * case the buffer doesn't move and we can short-circuit the relocation<br>
     * processing in the kernel<br>
+    *<br>
+    * Some target_offsets may be negative, so extend the sign to 64 bits.<br>
     */<br>
-   return entry->offset + target_offset;<br>
+   return entry->offset + (int64_t)((int32_t)target_offs<wbr>et);<br>
 }<br>
<br>
 uint64_t<span class="HOEnZb"><font color="#888888"><br>
<span class="m_-5277273704394100473HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_-5277273704394100473gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Sergii Romantsov<br></div><div dir="ltr"><div style="margin:0px;padding:0px;color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-size:14px">GlobalLogic Inc.<br><a href="http://www.globallogic.com/" rel="nofollow" style="color:rgb(0,82,204)" target="_blank">www.globallogic.com</a><br></div></div></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Stuart Young (aka Cefiar)</div>
</div>