mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
anv: enable VK_KHR_copy_memory_indirect for ASTC formats
If you have vk_require_astc=true, this will allow the formats to work. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
This commit is contained in:
parent
0bd9aa85eb
commit
69b11f7b25
1 changed files with 28 additions and 14 deletions
|
|
@ -748,28 +748,41 @@ anv_color_format_supports_drm_modifier_tiling(const struct anv_physical_device *
|
|||
}
|
||||
|
||||
static VkFormatFeatureFlags2
|
||||
anv_get_compressed_emulated_format_features(const struct anv_format *anv_format,
|
||||
anv_get_compressed_emulated_format_features(const struct anv_physical_device *pdevice,
|
||||
const struct anv_format *anv_format,
|
||||
const VkImageTiling vk_tiling)
|
||||
{
|
||||
VkFormatFeatureFlags2 flags = 0;
|
||||
|
||||
assert(isl_format_is_compressed(anv_format->planes[0].isl_format));
|
||||
|
||||
/* Require optimal tiling so that we can decompress on upload */
|
||||
if (vk_tiling == VK_IMAGE_TILING_OPTIMAL) {
|
||||
switch (vk_tiling) {
|
||||
case VK_IMAGE_TILING_OPTIMAL:
|
||||
/* Required features for compressed formats */
|
||||
return VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT |
|
||||
VK_FORMAT_FEATURE_2_BLIT_SRC_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_HOST_IMAGE_TRANSFER_BIT_EXT;
|
||||
} else if (vk_tiling == VK_IMAGE_TILING_LINEAR) {
|
||||
flags |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT |
|
||||
VK_FORMAT_FEATURE_2_BLIT_SRC_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_HOST_IMAGE_TRANSFER_BIT_EXT;
|
||||
break;
|
||||
|
||||
case VK_IMAGE_TILING_LINEAR:
|
||||
/* Images used for transfers */
|
||||
return VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT |
|
||||
VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT |
|
||||
VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT;
|
||||
flags |= VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT |
|
||||
VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT |
|
||||
VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT;
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (anv_format_supports_indirect_copies(pdevice, anv_format))
|
||||
flags |= VK_FORMAT_FEATURE_2_COPY_IMAGE_INDIRECT_DST_BIT_KHR;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static VkFormatFeatureFlags2
|
||||
|
|
@ -1163,7 +1176,8 @@ anv_get_image_format_features2(const struct anv_physical_device *physical_device
|
|||
}
|
||||
|
||||
if (anv_is_compressed_format_emulated(physical_device, vk_format)) {
|
||||
return anv_get_compressed_emulated_format_features(anv_format,
|
||||
return anv_get_compressed_emulated_format_features(physical_device,
|
||||
anv_format,
|
||||
vk_tiling);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue