i965/gen6+: Fix multisample assertions in CopyTexSubImage hw blitter path. 52/6852/1
authorPaul Berry <stereotype441@gmail.com>
Sun, 2 Jun 2013 21:31:46 +0000 (14:31 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 4 Jun 2013 16:14:40 +0000 (09:14 -0700)
commit32d1f423bccb1ad7199f072d4ac09ed88b693b1f
treed9fa373764288ab46f7e9d128717f1eb37a0acb4
parent7bafd88c153e395274b632e7eae4bc9fc3aec1d2
i965/gen6+: Fix multisample assertions in CopyTexSubImage hw blitter path.

Commit 045612c (intel: Add an assert for glCopyTexSubImage() being
called on MSAA buffers) added an assertion to intel_copy_texsubimage()
to make sure that multisampling was not in use, based on the
assumption that glCopyTexSubImage() can't legally be used with
multisampling.

However, there is one case where glCopyTexSubImage() can legally be
used with multisampling: when the source buffer is a multisampled
window system buffer.  If the source and destination color formats
don't match, the blorp path will fail, so intel_copy_texsubimage()
will be called.  In this case, we need intel_copy_texsubimage() to
return false so that we fall back to meta to do the copy.  (The
multisampled source buffer won't cause a problem for the meta path,
because it uses glReadPixels, which forces a multisample resolve).

It's still safe to assert that the destination image is
single-sampled, because it's not legal to call glCopyTexSubImage() on
multisampled textures.

Fixes some failures with piglit tests "copyteximage
{1D,2D,CUBE,RECT,2D_ARRAY}" (with "samples=..." argument).

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/intel/intel_tex_copy.c