radeonsi: enable dithered alpha-to-coverage for better quality
authorMarek Olšák <marek.olsak@amd.com>
Tue, 15 Jan 2019 02:21:28 +0000 (21:21 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 30 Jan 2019 17:35:22 +0000 (12:35 -0500)
same as AMDVLK.

GL_NV_alpha_to_coverage_dither_control allows controlling this behavior.
The default is implementation-dependent.

src/gallium/drivers/radeonsi/si_state.c

index 89d81c97e18bedcf7ba9fdd8789f432ca783a14b..b49a1b3695e451e34e0854d98d7880f76cdbef2a 100644 (file)
@@ -474,10 +474,11 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
 
        si_pm4_set_reg(pm4, R_028B70_DB_ALPHA_TO_MASK,
                       S_028B70_ALPHA_TO_MASK_ENABLE(state->alpha_to_coverage) |
-                      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));
+                      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 (state->alpha_to_coverage)
                blend->need_src_alpha_4bit |= 0xf;