@@ -456,6 +456,21 @@ impl super::Device {
456456 & self ,
457457 desc : & crate :: TextureDescriptor ,
458458 external_memory_image_create_info : Option < & mut vk:: ExternalMemoryImageCreateInfo > ,
459+ ) -> Result < ImageWithoutMemory , crate :: DeviceError > {
460+ self . create_image_without_memory_with_tiling (
461+ desc,
462+ vk:: ImageTiling :: OPTIMAL ,
463+ external_memory_image_create_info,
464+ None ,
465+ )
466+ }
467+
468+ fn create_image_without_memory_with_tiling (
469+ & self ,
470+ desc : & crate :: TextureDescriptor ,
471+ tiling : vk:: ImageTiling ,
472+ external_memory_image_create_info : Option < & mut vk:: ExternalMemoryImageCreateInfo > ,
473+ drm_modifier_info : Option < & mut vk:: ImageDrmFormatModifierExplicitCreateInfoEXT > ,
459474 ) -> Result < ImageWithoutMemory , crate :: DeviceError > {
460475 let copy_size = desc. copy_extent ( ) ;
461476
@@ -496,7 +511,7 @@ impl super::Device {
496511 . mip_levels ( desc. mip_level_count )
497512 . array_layers ( desc. array_layer_count ( ) )
498513 . samples ( vk:: SampleCountFlags :: from_raw ( desc. sample_count ) )
499- . tiling ( vk :: ImageTiling :: OPTIMAL )
514+ . tiling ( tiling )
500515 . usage ( conv:: map_texture_usage ( desc. usage ) )
501516 . sharing_mode ( vk:: SharingMode :: EXCLUSIVE )
502517 . initial_layout ( vk:: ImageLayout :: UNDEFINED ) ;
@@ -511,6 +526,10 @@ impl super::Device {
511526 vk_info = vk_info. push_next ( ext_info) ;
512527 }
513528
529+ if let Some ( drm_info) = drm_modifier_info {
530+ vk_info = vk_info. push_next ( drm_info) ;
531+ }
532+
514533 let raw = unsafe { self . shared . raw . create_image ( & vk_info, None ) } . map_err ( map_err) ?;
515534 fn map_err ( err : vk:: Result ) -> crate :: DeviceError {
516535 // We don't use VK_EXT_image_compression_control
0 commit comments