i965: Clamp clear colors to the representable range
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 16 Jun 2017 07:13:45 +0000 (00:13 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 23 Jun 2017 19:30:24 +0000 (12:30 -0700)
commitf1fa4be871e13c68b50685aaf64dc095b49ed0b5
tree2b9d8dea92b16c7bc48e716180a99fd351d1618d
parent793b312b4ad57e1f5a3bfa9405169e108384bdbc
i965: Clamp clear colors to the representable range

Starting with Sky Lake, we can clear to arbitrary floats or integers.
Unfortunately, the hardware isn't particularly smart when it comes
sampling from that clear color.  If the clear color is out of range for
the surface format, it will happily return whatever we put in the
surface state packet unmodified.  In order to avoid returning bogus
values for surfaces with a limited range, we need to do some clamping.

Cc: "17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/mesa/drivers/dri/i965/brw_meta_util.c