diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2012-12-25 20:55:38 -0800 |
---|---|---|
committer | Andreas Boll <andreas.boll.dev@gmail.com> | 2013-04-17 13:30:38 +0200 |
commit | a0cf6a44ab428a397a011acdda154c1ab706b18b (patch) | |
tree | 80aab1c700ebb9735f3f9490b871b96aee480824 | |
parent | f3baee53cf2f499e39163680b4234140febaa4c1 (diff) |
i965: Fail to blit rather than assert on invalid pitch requirements.
Dungeon Defenders hits TexImage()'s try_pbo_upload() path where
image->Width == 2, which doesn't meet intelEmitCopyBlit's requirement
that the pitch needs to be a multiple of 4.
Since intelEmitCopyBlit can already fail for a myriad of other reasons,
and it's not clear that other callers are immune to this failure mode,
simply make it return false rather than assert.
Fixes Dungeon Defenders on i965/Ivybridge. Now playable (aside from
having to work around the EXT_bindable_uniform issue).
NOTE: This is probably a candidate for the 9.0 branch.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 66ea6e8ec3f7ee44e0011b1dd563fef76ead8bc5)
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_blit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 36a2c6aada..29d972a6ff 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -150,8 +150,8 @@ intelEmitCopyBlit(struct intel_context *intel, /* Blit pitch must be dword-aligned. Otherwise, the hardware appears to drop * the low bits. */ - assert(src_pitch % 4 == 0); - assert(dst_pitch % 4 == 0); + if (src_pitch % 4 != 0 || dst_pitch % 4 != 0) + return false; /* For big formats (such as floating point), do the copy using 32bpp and * multiply the coordinates. |