i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.
authorPaul Berry <stereotype441@gmail.com>
Wed, 27 Nov 2013 15:43:03 +0000 (07:43 -0800)
committerPaul Berry <stereotype441@gmail.com>
Sat, 30 Nov 2013 05:46:31 +0000 (21:46 -0800)
commitc4cf487315f1f5375534f1677177983fa496d577
treea41225a8883ff53c731a11d2e6c11ac4830e6cf9
parent26498e0f0c198ac912b176cf9a14768ad2c0244c
i965/gen6: Fix multisample resolve blits for luminance/intensity 32F formats.

On gen6, multisamble resolve blits use the SAMPLE message to blend
together the 4 samples for each texel.  For some reason, SAMPLE
doesn't blend together the proper samples when the source format is
L32_FLOAT or I32_FLOAT, resulting in blocky artifacts.

To work around this problem, sample from the source surface using
R32_FLOAT.  This shouldn't affect rendering correctness, because when
doing these resolve blits, the destination format is R32_FLOAT, so the
channel replication done by L32_FLOAT and I32_FLOAT is unnecessary.

Fixes piglit tests on Sandy Bridge:
- spec/ARB_texture_float/multisample-formats 2 GL_ARB_texture_float
- spec/ARB_texture_float/multisample-formats 4 GL_ARB_texture_float

No piglit regressions on Sandy Bridge.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70601

Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp