@@ -196,7 +196,7 @@ int32_t AllocatorVK::FindMemoryTypeIndex(
196196 return type_index;
197197}
198198
199- static constexpr vk::ImageUsageFlags ToVKImageUsageFlags (
199+ vk::ImageUsageFlags AllocatorVK:: ToVKImageUsageFlags (
200200 PixelFormat format,
201201 TextureUsageMask usage,
202202 StorageMode mode,
@@ -219,30 +219,16 @@ static constexpr vk::ImageUsageFlags ToVKImageUsageFlags(
219219 vk_usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
220220 } else {
221221 vk_usage |= vk::ImageUsageFlagBits::eColorAttachment;
222+ vk_usage |= vk::ImageUsageFlagBits::eInputAttachment;
222223 }
223- vk_usage |= vk::ImageUsageFlagBits::eInputAttachment;
224224 }
225225
226226 if (usage & TextureUsage::kShaderRead ) {
227227 vk_usage |= vk::ImageUsageFlagBits::eSampled;
228- // Device transient images can only be used as attachments. The caller
229- // specified incorrect usage flags and is attempting to read a device
230- // transient image in a shader. Unset the transient attachment flag. See:
231- // https://github.com/flutter/flutter/issues/121633
232- if (mode == StorageMode::kDeviceTransient ) {
233- vk_usage &= ~vk::ImageUsageFlagBits::eTransientAttachment;
234- }
235228 }
236229
237230 if (usage & TextureUsage::kShaderWrite ) {
238231 vk_usage |= vk::ImageUsageFlagBits::eStorage;
239- // Device transient images can only be used as attachments. The caller
240- // specified incorrect usage flags and is attempting to read a device
241- // transient image in a shader. Unset the transient attachment flag. See:
242- // https://github.com/flutter/flutter/issues/121633
243- if (mode == StorageMode::kDeviceTransient ) {
244- vk_usage &= ~vk::ImageUsageFlagBits::eTransientAttachment;
245- }
246232 }
247233
248234 if (mode != StorageMode::kDeviceTransient ) {
@@ -314,9 +300,9 @@ class AllocatedTextureSourceVK final : public TextureSourceVK {
314300 image_info.arrayLayers = ToArrayLayerCount (desc.type );
315301 image_info.tiling = vk::ImageTiling::eOptimal;
316302 image_info.initialLayout = vk::ImageLayout::eUndefined;
317- image_info.usage =
318- ToVKImageUsageFlags ( desc.format , desc.usage , desc.storage_mode ,
319- supports_memoryless_textures);
303+ image_info.usage = AllocatorVK::ToVKImageUsageFlags (
304+ desc.format , desc.usage , desc.storage_mode ,
305+ supports_memoryless_textures);
320306 image_info.sharingMode = vk::SharingMode::eExclusive;
321307
322308 VmaAllocationCreateInfo alloc_nfo = {};
0 commit comments