OSDN Git Service

i965: Make sure we blit a full compressed block
authorBen Widawsky <benjamin.widawsky@intel.com>
Sun, 7 Feb 2016 02:11:21 +0000 (18:11 -0800)
committerBen Widawsky <benjamin.widawsky@intel.com>
Wed, 10 Feb 2016 22:08:46 +0000 (14:08 -0800)
commit088280e022bca10c3712dfa6f8e0ff343a37ce77
treec83b7294f112930511ee2fb01cbefd1840b3cd63
parent79d0082c6442d4c1cade1c4a4904c349f8511f4a
i965: Make sure we blit a full compressed block

This fixes an assertion failure in [at least] one of the Unreal Engine Linux
demo/games that uses DXT1 compression. Specifically, the "Vehicle Game".

At some point, the game ends up trying to blit mip level whose size is 2x2,
which is smaller than a DXT1 block. As a result, the assertion in the blit path
is triggered. It should be safe to simply make sure we align the width and
height, which is sadly an example of compression being less efficient.

NOTE: The demo seems to work fine without the assert, and therefore release
builds of mesa wouldn't stumble over this. Perhaps there is some unnoticeable
corruption, but I had trouble spotting it.

Thanks to Jason for looking at my backtrace and figuring out what was going on.

v2: Use NPOT alignment to make sure ASTC is handled properly (Ilia)
Remove comment about how this doesn't fix other bugs, because it does.

Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93358
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/intel_copy_image.c