i965: Always emit alpha when nr_color_buffers == 0.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 12 Jul 2012 18:25:58 +0000 (11:25 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 12 Jul 2012 20:35:46 +0000 (13:35 -0700)
commit86e401b771ce4a6f9a728f76c5061c339f012d0a
treebe142dab4d8d1dac280824efd9229deebff5cb5e
parent16060531baa837304eb7a427d0cdbeccd95cf09a
i965: Always emit alpha when nr_color_buffers == 0.

If alpha-testing is enabled, we need to send alpha down the pipeline
even if nr_color_buffers == 0.  However, tracking whether alpha-testing
is enabled in the WM program key is expensive: it causes us to compile
multiple specializations of the same shader, using program cache space.

This patch removes the check for alpha-testing, and simply emits alpha
whenever nr_color_buffers == 0.  We believe this will also be necessary
for alpha-to-coverage, and it should add minimal overhead to an uncommon
case.  Saving the recompiles should more than make up the difference.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_wm.c
src/mesa/drivers/dri/i965/brw_wm.h