Discussion:
[PATCH] radeonsi: fix alpha-to-coverage if color writes are disabled
(too old to reply)
Józef Kucia
2017-12-31 09:19:15 UTC
Permalink
If alpha-to-coverage is enabled, we have to compute alpha
even if color writes are disabled.

Signed-off-by: Józef Kucia <***@gmail.com>
---

Found while running The Witness under Wine.

---
src/gallium/drivers/radeonsi/si_state_shaders.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 9143f61fcdf2..eaf72e8ee684 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1173,6 +1173,8 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx,
ps->info.writes_stencil ||
ps->info.writes_samplemask ||
si_get_alpha_test_func(sctx) != PIPE_FUNC_ALWAYS;
+ const struct si_state_blend *blend = sctx->queued.named.blend;
+ bool alpha_to_coverage = blend && blend->alpha_to_coverage;

unsigned ps_colormask = sctx->framebuffer.colorbuf_enabled_4bit &
sctx->queued.named.blend->cb_target_mask;
@@ -1182,7 +1184,8 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx,
ps_disabled = sctx->queued.named.rasterizer->rasterizer_discard ||
(!ps_colormask &&
!ps_modifies_zs &&
- !ps->info.writes_memory);
+ !ps->info.writes_memory &&
+ !alpha_to_coverage);
}

/* Find out which VS outputs aren't used by the PS. */
--
2.15.1
Marek Olšák
2018-01-04 01:12:07 UTC
Permalink
Thanks! I slightly modified the patch and pushed it.

Marek
Post by Józef Kucia
If alpha-to-coverage is enabled, we have to compute alpha
even if color writes are disabled.
---
Found while running The Witness under Wine.
---
src/gallium/drivers/radeonsi/si_state_shaders.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 9143f61fcdf2..eaf72e8ee684 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1173,6 +1173,8 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx,
ps->info.writes_stencil ||
ps->info.writes_samplemask ||
si_get_alpha_test_func(sctx) != PIPE_FUNC_ALWAYS;
+ const struct si_state_blend *blend = sctx->queued.named.blend;
+ bool alpha_to_coverage = blend && blend->alpha_to_coverage;
unsigned ps_colormask = sctx->framebuffer.colorbuf_enabled_4bit &
sctx->queued.named.blend->cb_target_mask;
@@ -1182,7 +1184,8 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx,
ps_disabled = sctx->queued.named.rasterizer->rasterizer_discard ||
(!ps_colormask &&
!ps_modifies_zs &&
- !ps->info.writes_memory);
+ !ps->info.writes_memory &&
+ !alpha_to_coverage);
}
/* Find out which VS outputs aren't used by the PS. */
--
2.15.1
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Loading...