File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -737,7 +737,14 @@ impl super::Device {
737737 // VK_ERROR_COMPRESSION_EXHAUSTED_EXT
738738 super :: map_host_device_oom_and_ioca_err ( err)
739739 }
740- let req = unsafe { self . shared . raw . get_image_memory_requirements ( raw) } ;
740+ let mut req = unsafe { self . shared . raw . get_image_memory_requirements ( raw) } ;
741+
742+ if desc. usage . contains ( wgt:: TextureUses :: TRANSIENT ) {
743+ let mem_type_index = self . find_memory_type_index ( req. memory_type_bits , vk:: MemoryPropertyFlags :: LAZILY_ALLOCATED ) ;
744+ if let Some ( mem_type_index) = mem_type_index {
745+ req. memory_type_bits = 1 << mem_type_index;
746+ }
747+ }
741748
742749 Ok ( ImageWithoutMemory {
743750 raw,
@@ -1263,19 +1270,13 @@ impl crate::Device for super::Device {
12631270 unsafe { self . shared . raw . destroy_image ( image. raw , None ) } ;
12641271 } ) ?;
12651272
1266- let mut alloc_usage = gpu_alloc:: UsageFlags :: FAST_DEVICE_ACCESS ;
1267- alloc_usage. set (
1268- gpu_alloc:: UsageFlags :: TRANSIENT ,
1269- desc. usage . contains ( wgt:: TextureUses :: TRANSIENT ) ,
1270- ) ;
1271-
12721273 let block = unsafe {
12731274 self . mem_allocator . lock ( ) . alloc (
12741275 & * self . shared ,
12751276 gpu_alloc:: Request {
12761277 size : image. requirements . size ,
12771278 align_mask : image. requirements . alignment - 1 ,
1278- usage : alloc_usage ,
1279+ usage : gpu_alloc :: UsageFlags :: FAST_DEVICE_ACCESS ,
12791280 memory_types : image. requirements . memory_type_bits & self . valid_ash_memory_types ,
12801281 } ,
12811282 )
You can’t perform that action at this time.
0 commit comments