Mesa (17.2): radv: Use the correct channel for alpha in resolve srgb conversion.

Emil Velikov evelikov at kemper.freedesktop.org
Sat Aug 12 16:12:26 UTC 2017


Module: Mesa
Branch: 17.2
Commit: 9d65214f3dd7d17403da249af9ea469027a6fe34
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d65214f3dd7d17403da249af9ea469027a6fe34

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sun Aug  6 01:58:21 2017 +0200

radv: Use the correct channel for alpha in resolve srgb conversion.

The argument here is a bitmask, so the old code selected .xy, which
got silently truncated to .x when constructing the vec4 from components,
instead of using .w.

Fixes: 588185eb6b7 "radv/meta: add srgb conversion to end of resolve shader."
Reviewed-by: Dave Airlie <airlied at redhat.com>
(cherry picked from commit acba3a3151dbbba0ab834e062e0feb12af4873de)

---

 src/amd/vulkan/radv_meta_resolve_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_meta_resolve_cs.c b/src/amd/vulkan/radv_meta_resolve_cs.c
index f13e79ef0c..d20d04231e 100644
--- a/src/amd/vulkan/radv_meta_resolve_cs.c
+++ b/src/amd/vulkan/radv_meta_resolve_cs.c
@@ -66,7 +66,7 @@ static nir_ssa_def *radv_meta_build_resolve_srgb_conversion(nir_builder *b,
 	nir_ssa_def *comp[4];
 	for (i = 0; i < 3; i++)
 		comp[i] = nir_bcsel(b, cmp[i], ltvals[i], gtvals[i]);
-	comp[3] = nir_channels(b, input, 3);
+	comp[3] = nir_channels(b, input, 1 << 3);
 	return nir_vec(b, comp, 4);
 }
 




More information about the mesa-commit mailing list