OSDN Git Service

i965: Make intelEmitCopyBlit not truncate large strides.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 22 Jan 2017 09:44:08 +0000 (01:44 -0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 3 Feb 2017 11:08:55 +0000 (11:08 +0000)
commit2554c98d70f4a919fbe71c43e6261b799d2cd6ba
tree5785f1b36e027e5f5473dcee0c9b9a890dee4612
parent31715781c62f506875a7fea017aff64fdac643af
i965: Make intelEmitCopyBlit not truncate large strides.

When trying to blit larger tiled surfaces, the pitch can be larger than
32768 bytes, which means it won't fit in a GLshort.  Passing it in will
truncate the stride to 0, which has...surprising results.

The pitch can be up to 32,768 DWords, or 128kB.  We measure it in bytes,
but divide by 4 when programming it.  So we need to handle values up to
131,072.  Switch from GLshort to int32_t to avoid the truncation.

Fixes GL45-CTS.gtf30.GL3Tests.depth_texture.depth_texture_copyteximage
at widths greater than 8192.

v2: Use int32_t as negative values can be used (Jason).

Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit f8f7ea508be7fe7222cd19e0d59574cfea2decf0)
src/mesa/drivers/dri/i965/intel_blit.c
src/mesa/drivers/dri/i965/intel_blit.h