[Mesa-dev] [PATCH] i965: Set brw_wm_prog_key::alpha_test only if nr_color_buffers == 0.

Eric Anholt eric at anholt.net
Mon Jun 18 14:24:12 PDT 2012


On Sat, 16 Jun 2012 21:27:14 -0700, Kenneth Graunke <kenneth at whitecape.org> wrote:
> If alpha testing is enabled, we need to include alpha in the FB write.
> Normally, this occurs as part of a color buffer write, but it's possible
> to use alpha testing without any color buffers.  The alpha_test flag
> lets brw_fs.cpp know that the shader needs to send alpha anyway.
> 
> Since the flag's only use occurs when nr_color_buffers == 0, we don't
> need to set it in the general case; in fact, doing so will result in two
> indentical shaders being compiled, wasting time and program cache space.
> 
> This patch also renames it to "alpha_only", since it no longer
> represents when alpha testing is enabled or disabled.

Hmm.  I'm wondering if we shouldn't just always emit source 0 alpha,
even for nr_color_buffers != 0.  I think it's going to be needed for
alpha-to-coverage as well.  People setting gl_FragColor for
nr_color_buffers = 0 are just being silly, right?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120618/45724c0e/attachment.pgp>


More information about the mesa-dev mailing list