pub fn new(
        vd: &impl VulkanDeviceOwned,
        ty: ImageType,
        extent: Extent2D,
        format: VulkanFormat,
        samples: SampleCount,
        usage: ImageUsage,
        memory_usage: VmaMemoryUsageType,
    ) -> Self {
        let width = extent.x;
        let height = extent.y;

        let info = VkImageCreateInfo {
            flags: 0,
            image_type: ty.into(),
            format: format.into(),
            extent: VkExtent3D {
                width,
                height,
                depth: 1,
            },
            // TODO
            mip_levels: 1,
            array_layers: 1,
            samples: samples.into(),
            tiling: ImageTiling::Optimal.into(),
            usage: usage.bits(),
            sharing_mode: SharingMode::Exclusive.into(),
            queue_family_index_count: 0,
            queue_family_indices: ptr::null(),
            initial_layout: ImageLayout::Undefined.into(),
            ..Default::default()
        };

        let vma_info = VmaAllocationCreateInfo {
            flags: 0,
            usage: memory_usage.into(),
            required_flags: 0,
            preferred_flags: 0,
            memory_type_bits: 0,
            pool: 0,
            user_data: ptr::null_mut(),
            priority: 0.0,
        };

        let (image, allocation, allocation_info) =
            vd.vd().vma_create_image(&info, &vma_info).unwrap();

        Self {
            image,
            extent,
            format,
            samples,
            usage,
            layout: ImageLayout::Undefined,
            allocation,
            _allocation_info: allocation_info,
            // vd,
        }
    }
/// Create new VkImage with specific options.
Create new VkImage with specific options.
Create new VkImage with specific options .
pub fn new(
        vd: &impl VulkanDeviceOwned,
        ty: ImageType,
        extent: Extent2D,
        format: VulkanFormat,
        samples: SampleCount,
        usage: ImageUsage,
        memory_usage: VmaMemoryUsageType,
    ) -> Self {
        let width = extent.x;
        let height = extent.y;
        let info = VkImageCreateInfo {
            flags: 0,
            image_type: ty.into(),
            format: format.into(),
            extent: VkExtent3D {
                width,
                height,
                depth: 1,
            },
            // TODO
            mip_levels: 1,
            array_layers: 1,
            samples: samples.into(),
            tiling: ImageTiling::Optimal.into(),
            usage: usage.bits(),
            sharing_mode: SharingMode::Exclusive.into(),
            queue_family_index_count: 0,
            queue_family_indices: ptr::null(),
            initial_layout: ImageLayout::Undefined.into(),
            ..Default::default()
        };
        let vma_info = VmaAllocationCreateInfo {
            flags: 0,
            usage: memory_usage.into(),
            required_flags: 0,
            preferred_flags: 0,
            memory_type_bits: 0,
            pool: 0,
            user_data: ptr::null_mut(),
            priority: 0.0,
        };
        let (image, allocation, allocation_info) =
            vd.vd().vma_create_image(&info, &vma_info).unwrap();
        Self {
            image,
            extent,
            format,
            samples,
            usage,
            layout: ImageLayout::Undefined,
            allocation,
            _allocation_info: allocation_info,
            // vd,
        }
    }
pub fn new ( vd : & impl VulkanDeviceOwned , ty : ImageType , extent : Extent2D , format : VulkanFormat , samples : SampleCount , usage : ImageUsage , memory_usage : VmaMemoryUsageType , ) -> Self { let width = extent . x ; let height = extent . y ; let info = VkImageCreateInfo { flags : 0 , image_type : ty . into ( ) , format : format . into ( ) , extent : VkExtent3D { width , height , depth : 1 , } , // TODO mip_levels : 1 , array_layers : 1 , samples : samples . into ( ) , tiling : ImageTiling :: Optimal . into ( ) , usage : usage . bits ( ) , sharing_mode : SharingMode :: Exclusive . into ( ) , queue_family_index_count : 0 , queue_family_indices : ptr :: null ( ) , initial_layout : ImageLayout :: Undefined . into ( ) , .. Default :: default ( ) } ; let vma_info = VmaAllocationCreateInfo { flags : 0 , usage : memory_usage . into ( ) , required_flags : 0 , preferred_flags : 0 , memory_type_bits : 0 , pool : 0 , user_data : ptr :: null_mut ( ) , priority : 0.0 , } ; let ( image , allocation , allocation_info ) = vd . vd ( ) . vma_create_image ( & info , & vma_info ) . unwrap ( ) ; Self { image , extent , format , samples , usage , layout : ImageLayout :: Undefined , allocation , _allocation_info : allocation_info , // vd, } }
Create new VkImage with specific options.
Create new VkImage with specific options .
vd
&impl VulkanDeviceOwned
ty
ImageType
extent
Extent2D
format
VulkanFormat
samples
SampleCount
usage
ImageUsage
memory_usage
VmaMemoryUsageType
vd
&impl VulkanDeviceOwned
ty
ImageType
extent
Extent2D
format
VulkanFormat
samples
SampleCount
usage
ImageUsage
memory_usage
VmaMemoryUsageType