diff options
author | Marek Olšák <[email protected]> | 2018-10-29 20:46:48 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-11-09 14:55:04 -0500 |
commit | 832ab883e2773fd276888f1d93cba5e1bbce0ec9 (patch) | |
tree | efa556988039f5a35e417187420f8e4b1dd6b247 /src/gallium/drivers | |
parent | d059eae269c333ea2542b58167983c7c5007c219 (diff) |
radeonsi: use better DCC clear codes
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_clear.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c index 8aa3355afc8..3f5375337a1 100644 --- a/src/gallium/drivers/radeonsi/si_clear.c +++ b/src/gallium/drivers/radeonsi/si_clear.c @@ -34,6 +34,15 @@ enum { SI_CLEAR_SURFACE = SI_SAVE_FRAMEBUFFER | SI_SAVE_FRAGMENT_STATE, }; +enum si_dcc_clear_code +{ + DCC_CLEAR_COLOR_0000 = 0x00000000, + DCC_CLEAR_COLOR_0001 = 0x40404040, + DCC_CLEAR_COLOR_1110 = 0x80808080, + DCC_CLEAR_COLOR_1111 = 0xC0C0C0C0, + DCC_CLEAR_COLOR_REG = 0x20202020, +}; + static void si_alloc_separate_cmask(struct si_screen *sscreen, struct si_texture *tex) { @@ -133,7 +142,7 @@ static bool vi_get_fast_clear_parameters(enum pipe_format base_format, return false; *eliminate_needed = true; - *clear_value = 0x20202020U; /* use CB clear color registers */ + *clear_value = DCC_CLEAR_COLOR_REG; if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) return true; /* need ELIMINATE_FAST_CLEAR */ @@ -208,10 +217,17 @@ static bool vi_get_fast_clear_parameters(enum pipe_format base_format, */ *eliminate_needed = false; - if (color_value) - *clear_value |= 0x80808080U; - if (alpha_value) - *clear_value |= 0x40404040U; + if (color_value) { + if (alpha_value) + *clear_value = DCC_CLEAR_COLOR_1111; + else + *clear_value = DCC_CLEAR_COLOR_1110; + } else { + if (alpha_value) + *clear_value = DCC_CLEAR_COLOR_0001; + else + *clear_value = DCC_CLEAR_COLOR_0000; + } return true; } |