radv: Use the correct channel for alpha in resolve srgb conversion.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 5 Aug 2017 23:58:21 +0000 (01:58 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 6 Aug 2017 14:07:13 +0000 (16:07 +0200)
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@redhat.com>
src/amd/vulkan/radv_meta_resolve_cs.c

index f13e79ef0ced55ce08fcd0c9e069bc74f88f09ee..d20d04231ed6c32396481f775fe60c6b354f8a58 100644 (file)
@@ -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);
 }