i965: For color clears, only disable writes to components that exist.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 21 Mar 2014 10:47:16 +0000 (03:47 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 21 Mar 2014 22:35:08 +0000 (15:35 -0700)
commit2919c3fdb40cf457f2e47f378a46f4cefa9e9f6d
tree4911c7540a1ee470baa30c57d7471f4d9dda3c1e
parenta63db538adc249f11f2083cc303f0daf7e471aa2
i965: For color clears, only disable writes to components that exist.

The SIMD16 replicated FB write message only works if we don't need the
color calculator to mask our framebuffer writes.  Previously, we bailed
on it if color_mask wasn't <true, true, true, true>.  However, this was
needlessly strict for formats with fewer than four components - only the
components that actually exist matter.

WebGL Aquarium attempts to clear a BGRX texture with the ColorMask set
to <true, true, true, false>.  This will work perfectly fine with the
replicated data message; we just bailed unnecessarily.

Improves performance of WebGL Aquarium on Iris Pro (at 1920x1080) by
abound 40%, and Bay Trail (at 1366x768) by over 70% (using Chrome 24).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com>
src/mesa/drivers/dri/i965/brw_blorp_clear.cpp