st/mesa: only enable MSAA coverage options when we have a MSAA buffer

Graphics / Mesa 3D Graphics Library / Mesa - Brian Paul [vmware.com] - 16 September 2016 09:44 UTC

Regardless of whether GL_MULTISAMPLE is enabled (it's enabled by default) we should not set the alpha_to_coverage or alpha_to_one flags if the current drawing buffer does not do MSAA.

This fixes the new piglit gl-1.3-alpha_to_coverage_nop test.

ETQW is a game that enables GL_SAMPLE_ALPHA_TO_COVERAGE without MSAA. Shrubs along the side of roads were invisible because fragments with alpha < 0.5 were being discarded (zero coverage).

v2: remove ctx->DrawBuffer != NULL check.

a01872f st/mesa: only enable MSAA coverage options when we have a MSAA buffer
src/mesa/state_tracker/st_atom_blend.c | 8 +++++---
src/mesa/state_tracker/st_context.c | 3 ++-
2 files changed, 7 insertions(+), 4 deletions(-)

Upstream: cgit.freedesktop.org


  • Share