nvk: Don't advertise tiling on non-power-of-two formats

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand
2023-01-30 20:11:55 -06:00
committed by Marge Bot
parent 60f41aca47
commit 2a2076b0d2

View File

@@ -26,6 +26,10 @@ nvk_get_image_format_features(struct nvk_physical_device *pdevice,
if (!nil_format_supports_texturing(pdevice->dev, p_format))
return 0;
/* You can't tile a non-power-of-two */
if (!util_is_power_of_two_nonzero(util_format_get_blocksize(p_format)))
return 0;
features |= VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT;
features |= VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT;
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT;