radv: hard code format features for emulated formats

The format features are known.  No need to rely on
radv_is_sampler_format_supported which will not work for ASTC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25071>
This commit is contained in:
Chia-I Wu
2023-09-13 16:21:27 -07:00
committed by Marge Bot
parent 99e54c39f6
commit dcb764b0f0

View File

@@ -649,8 +649,13 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
return;
}
if (desc->layout == UTIL_FORMAT_LAYOUT_ETC && !radv_device_supports_etc(physical_device) &&
!physical_device->emulate_etc2) {
if (desc->layout == UTIL_FORMAT_LAYOUT_ETC && !radv_device_supports_etc(physical_device)) {
if (radv_is_format_emulated(physical_device, format)) {
/* required features for compressed formats */
tiled = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT |
VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT |
VK_FORMAT_FEATURE_2_BLIT_SRC_BIT;
}
out_properties->linearTilingFeatures = linear;
out_properties->optimalTilingFeatures = tiled;
out_properties->bufferFeatures = buffer;