<div dir="ltr">On 25 December 2012 20:55, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dungeon Defenders hits TexImage()'s try_pbo_upload() path where<br>
image->Width == 2, which doesn't meet intelEmitCopyBlit's requirement<br>
that the pitch needs to be a multiple of 4.<br>
<br>
Since intelEmitCopyBlit can already fail for a myriad of other reasons,<br>
and it's not clear that other callers are immune to this failure mode,<br>
simply make it return false rather than assert.<br>
<br>
Fixes Dungeon Defenders on i965/Ivybridge. Now playable (aside from<br>
having to work around the EXT_bindable_uniform issue).<br>
<br>
NOTE: This is probably a candidate for the 9.0 branch.<br>
---<br>
src/mesa/drivers/dri/intel/intel_blit.c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c<br>
index 521e6eb..867d7b3 100644<br>
--- a/src/mesa/drivers/dri/intel/intel_blit.c<br>
+++ b/src/mesa/drivers/dri/intel/intel_blit.c<br>
@@ -150,8 +150,8 @@ intelEmitCopyBlit(struct intel_context *intel,<br>
/* Blit pitch must be dword-aligned. Otherwise, the hardware appears to drop<br>
* the low bits.<br>
*/<br>
- assert(src_pitch % 4 == 0);<br>
- assert(dst_pitch % 4 == 0);<br>
+ if (src_pitch % 4 != 0 || dst_pitch % 4 != 0)<br>
+ return false;<br>
<br>
/* For big formats (such as floating point), do the copy using 32bpp and<br>
* multiply the coordinates.<br>
<span class=""><font color="#888888">--<br>
1.8.0.2<br></font></span></blockquote><div><br></div><div>Looks reasonable to me.<br><br></div><div>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br><br>As a follow-up, we should probably check all of the code paths that lead into this function to make sure they invoke the proper fallback logic if there is a return value of false. I think that _mesa_ReadnPixelsARB, for example, will just fail to copy any data.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><font color="#888888">
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>