radv: use dithered alpha-to-coverage
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 9 Jan 2019 14:40:15 +0000 (14:40 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Wed, 16 Jan 2019 20:49:23 +0000 (20:49 +0000)
This matches the behaviour of AMDVLK and hides banding.
It is also seems to be allowed by the Vulkan spec.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c

index d9463a1e8b84bceb0f10c777de25918e47af4d82..3bf3c7ffef71d9819f0d2da5f51787a9da577a3c 100644 (file)
@@ -681,10 +681,11 @@ radv_pipeline_init_blend_state(struct radv_pipeline *pipeline,
        else
                blend.cb_color_control |= S_028808_ROP3(V_028808_ROP3_COPY);
 
-       blend.db_alpha_to_mask = S_028B70_ALPHA_TO_MASK_OFFSET0(2) |
-               S_028B70_ALPHA_TO_MASK_OFFSET1(2) |
-               S_028B70_ALPHA_TO_MASK_OFFSET2(2) |
-               S_028B70_ALPHA_TO_MASK_OFFSET3(2);
+       blend.db_alpha_to_mask = S_028B70_ALPHA_TO_MASK_OFFSET0(3) |
+               S_028B70_ALPHA_TO_MASK_OFFSET1(1) |
+               S_028B70_ALPHA_TO_MASK_OFFSET2(0) |
+               S_028B70_ALPHA_TO_MASK_OFFSET3(2) |
+               S_028B70_OFFSET_ROUND(1);
 
        if (vkms && vkms->alphaToCoverageEnable) {
                blend.db_alpha_to_mask |= S_028B70_ALPHA_TO_MASK_ENABLE(1);