nvk: Stop adding Vulkan image usage flags

The sampled and color attachment bits don't actually affect image layout
in any meaningful way.  They just cause us to create extra descriptors
in cases where we may not need them.  However, now that meta always sets
view usage, we always create the usages meta needs, even if the client
doesn't request them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36957>
This commit is contained in:
Faith Ekstrand 2025-08-23 11:11:23 -04:00 committed by Marge Bot
parent 446d5ef103
commit baeb070a94

View file

@ -768,18 +768,6 @@ nvk_image_init(struct nvk_device *dev,
vk_image_init(&dev->vk, &image->vk, pCreateInfo);
if ((image->vk.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) &&
image->vk.samples > 1) {
image->vk.usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
image->vk.stencil_usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
}
if (image->vk.usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT)
image->vk.usage |= VK_IMAGE_USAGE_SAMPLED_BIT;
if (image->vk.usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT)
image->vk.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
nil_image_usage_flags usage = 0;
if (image->vk.tiling == VK_IMAGE_TILING_LINEAR)
usage |= NIL_IMAGE_USAGE_LINEAR_BIT;