diff options
author | Samuel Pitoiset <[email protected]> | 2019-10-16 22:51:08 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-10-17 15:29:43 +0200 |
commit | c644644c651b5e852a2d7da3a89fbef1fa09669b (patch) | |
tree | 84b584f8146c52a4e055787464b9737df227ccd4 /src/amd/vulkan | |
parent | 82f18b713aceecf5ebf73d68e0cdd61be8aa2c59 (diff) |
radv: fix DCC fast clear code for intensity formats (correctly)
Previous fix was pretty bogus.
This fixes a rendering regression with Nier (minimap too large).
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1943
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1952
Fixes: ea92273cea8 ("radv: fix DCC fast clear code for intensity formats")
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_meta_clear.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index 6002fc87a61..0a967fc177a 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -1461,6 +1461,8 @@ static void vi_get_fast_clear_parameters(struct radv_device *device, int extra_channel; bool main_value = false; bool extra_value = false; + bool has_color = false; + bool has_alpha = false; int i; *can_avoid_fast_clear_elim = false; @@ -1479,9 +1481,6 @@ static void vi_get_fast_clear_parameters(struct radv_device *device, } else return; - bool image_alpha_is_on_msb = vi_alpha_is_on_msb(device, image_format); - bool view_alpha_is_on_msb = vi_alpha_is_on_msb(device, view_format); - for (i = 0; i < 4; i++) { int index = desc->swizzle[i] - VK_SWIZZLE_X; if (desc->swizzle[i] < VK_SWIZZLE_X || @@ -1510,23 +1509,21 @@ static void vi_get_fast_clear_parameters(struct radv_device *device, return; } - if (index == extra_channel) + if (index == extra_channel) { extra_value = values[i]; - else + has_alpha = true; + } else { main_value = values[i]; + has_color = true; + } } /* If alpha isn't present, make it the same as color, and vice versa. */ - if (!extra_value) + if (!has_alpha) extra_value = main_value; - else if (!main_value) + else if (!has_color) main_value = extra_value; - if (main_value != extra_value) { - assert(image_alpha_is_on_msb == view_alpha_is_on_msb); - return; /* require ELIMINATE_FAST_CLEAR */ - } - for (int i = 0; i < 4; ++i) if (values[i] != main_value && desc->swizzle[i] - VK_SWIZZLE_X != extra_channel && |