@@ -196,7 +196,7 @@ int32_t AllocatorVK::FindMemoryTypeIndex(
196
196
return type_index;
197
197
}
198
198
199
- static constexpr vk::ImageUsageFlags ToVKImageUsageFlags (
199
+ vk::ImageUsageFlags AllocatorVK:: ToVKImageUsageFlags (
200
200
PixelFormat format,
201
201
TextureUsageMask usage,
202
202
StorageMode mode,
@@ -219,30 +219,16 @@ static constexpr vk::ImageUsageFlags ToVKImageUsageFlags(
219
219
vk_usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
220
220
} else {
221
221
vk_usage |= vk::ImageUsageFlagBits::eColorAttachment;
222
+ vk_usage |= vk::ImageUsageFlagBits::eInputAttachment;
222
223
}
223
- vk_usage |= vk::ImageUsageFlagBits::eInputAttachment;
224
224
}
225
225
226
226
if (usage & TextureUsage::kShaderRead ) {
227
227
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
- }
235
228
}
236
229
237
230
if (usage & TextureUsage::kShaderWrite ) {
238
231
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
- }
246
232
}
247
233
248
234
if (mode != StorageMode::kDeviceTransient ) {
@@ -314,9 +300,9 @@ class AllocatedTextureSourceVK final : public TextureSourceVK {
314
300
image_info.arrayLayers = ToArrayLayerCount (desc.type );
315
301
image_info.tiling = vk::ImageTiling::eOptimal;
316
302
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);
320
306
image_info.sharingMode = vk::SharingMode::eExclusive;
321
307
322
308
VmaAllocationCreateInfo alloc_nfo = {};
0 commit comments