radv: Allow DCC for images with modifiers that are read-only.

If we avoid writing anything or decompressing this should be fine,
and allows gamescope to work without nodcc for radeonsi.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8817>
This commit is contained in:
Bas Nieuwenhuizen 2021-02-02 04:19:54 +01:00 committed by Marge Bot
parent b5ecf0748a
commit d248c91162

View file

@ -1128,8 +1128,8 @@ void radv_GetPhysicalDeviceFormatProperties(
}
static const struct ac_modifier_options radv_modifier_options = {
.dcc = false,
.dcc_retile = false,
.dcc = true,
.dcc_retile = true,
};
static VkFormatFeatureFlags
@ -1151,7 +1151,10 @@ radv_get_modifier_flags(struct radv_physical_device *dev,
return 0;
if (ac_modifier_has_dcc(modifier)) {
features &= ~VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
features &= ~(VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT |
VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
if (dev->instance->debug_flags & (RADV_DEBUG_NO_DCC | RADV_DEBUG_NO_DISPLAY_DCC))
return 0;