vulkan_lib/vma-rs/src/vma_bindings.rs
2023-01-14 13:03:01 +01:00

2202 lines
63 KiB
Rust

#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused)]
#![allow(deref_nullptr)]
use vulkan_sys::prelude::*;
pub type PFN_vkGetPhysicalDeviceProperties = extern "system" fn(
physicalDevice: VkPhysicalDevice,
pProperties: *mut VkPhysicalDeviceProperties,
);
pub type PFN_vkGetPhysicalDeviceMemoryProperties = extern "system" fn(
physicalDevice: VkPhysicalDevice,
pMemoryProperties: *mut VkPhysicalDeviceMemoryProperties,
);
pub type PFN_vkAllocateMemory = extern "system" fn(
device: VkDevice,
pAllocateInfo: *const VkMemoryAllocateInfo,
pAllocator: *const VkAllocationCallbacks,
pMemory: *mut VkDeviceMemory,
) -> VkResult;
pub type PFN_vkFreeMemory = extern "system" fn(
device: VkDevice,
memory: VkDeviceMemory,
pAllocator: *const VkAllocationCallbacks,
);
pub type PFN_vkMapMemory = extern "system" fn(
device: VkDevice,
memory: VkDeviceMemory,
offset: VkDeviceSize,
size: VkDeviceSize,
flags: VkMemoryMapFlags,
ppData: *mut *mut ::std::os::raw::c_void,
) -> VkResult;
pub type PFN_vkUnmapMemory = extern "system" fn(device: VkDevice, memory: VkDeviceMemory);
pub type PFN_vkFlushMappedMemoryRanges = extern "system" fn(
device: VkDevice,
memoryRangeCount: u32,
pMemoryRanges: *const VkMappedMemoryRange,
) -> VkResult;
pub type PFN_vkInvalidateMappedMemoryRanges = extern "system" fn(
device: VkDevice,
memoryRangeCount: u32,
pMemoryRanges: *const VkMappedMemoryRange,
) -> VkResult;
pub type PFN_vkBindBufferMemory = extern "system" fn(
device: VkDevice,
buffer: VkBuffer,
memory: VkDeviceMemory,
memoryOffset: VkDeviceSize,
) -> VkResult;
pub type PFN_vkBindImageMemory = extern "system" fn(
device: VkDevice,
image: VkImage,
memory: VkDeviceMemory,
memoryOffset: VkDeviceSize,
) -> VkResult;
pub type PFN_vkGetBufferMemoryRequirements = extern "system" fn(
device: VkDevice,
buffer: VkBuffer,
pMemoryRequirements: *mut VkMemoryRequirements,
);
pub type PFN_vkGetImageMemoryRequirements = extern "system" fn(
device: VkDevice,
image: VkImage,
pMemoryRequirements: *mut VkMemoryRequirements,
);
pub type PFN_vkCreateBuffer = extern "system" fn(
device: VkDevice,
pCreateInfo: *const VkBufferCreateInfo,
pAllocator: *const VkAllocationCallbacks,
pBuffer: *mut VkBuffer,
) -> VkResult;
pub type PFN_vkDestroyBuffer = extern "system" fn(
device: VkDevice,
buffer: VkBuffer,
pAllocator: *const VkAllocationCallbacks,
);
pub type PFN_vkCreateImage = extern "system" fn(
device: VkDevice,
pCreateInfo: *const VkImageCreateInfo,
pAllocator: *const VkAllocationCallbacks,
pImage: *mut VkImage,
) -> VkResult;
pub type PFN_vkDestroyImage =
extern "system" fn(device: VkDevice, image: VkImage, pAllocator: *const VkAllocationCallbacks);
pub type PFN_vkCmdCopyBuffer = extern "system" fn(
commandBuffer: VkCommandBuffer,
srcBuffer: VkBuffer,
dstBuffer: VkBuffer,
regionCount: u32,
pRegions: *const VkBufferCopy,
);
pub type PFN_vkGetImageMemoryRequirements2KHR = extern "system" fn(
device: VkDevice,
pInfo: *const VkImageMemoryRequirementsInfo2,
pMemoryRequirements: *mut VkMemoryRequirements2,
);
pub type PFN_vkGetBufferMemoryRequirements2KHR = extern "system" fn(
device: VkDevice,
pInfo: *const VkBufferMemoryRequirementsInfo2,
pMemoryRequirements: *mut VkMemoryRequirements2,
);
pub type PFN_vkBindBufferMemory2KHR = extern "system" fn(
device: VkDevice,
bindInfoCount: u32,
pBindInfos: *const VkBindBufferMemoryInfo,
) -> VkResult;
pub type PFN_vkBindImageMemory2KHR = extern "system" fn(
device: VkDevice,
bindInfoCount: u32,
pBindInfos: *const VkBindImageMemoryInfo,
) -> VkResult;
pub type PFN_vkGetPhysicalDeviceMemoryProperties2KHR = extern "system" fn(
physicalDevice: VkPhysicalDevice,
pMemoryProperties: *mut VkPhysicalDeviceMemoryProperties2KHR,
) -> ();
pub type VkFlags = u32;
/* automatically generated by rust-bindgen */
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocator_T {
_unused: [u8; 0],
}
pub type VmaAllocator = *mut VmaAllocator_T;
pub type PFN_vmaAllocateDeviceMemoryFunction = ::std::option::Option<
unsafe extern "C" fn(
allocator: VmaAllocator,
memoryType: u32,
memory: VkDeviceMemory,
size: VkDeviceSize,
pUserData: *mut ::std::os::raw::c_void,
),
>;
pub type PFN_vmaFreeDeviceMemoryFunction = ::std::option::Option<
unsafe extern "C" fn(
allocator: VmaAllocator,
memoryType: u32,
memory: VkDeviceMemory,
size: VkDeviceSize,
pUserData: *mut ::std::os::raw::c_void,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDeviceMemoryCallbacks {
pub pfnAllocate: PFN_vmaAllocateDeviceMemoryFunction,
pub pfnFree: PFN_vmaFreeDeviceMemoryFunction,
pub pUserData: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_VmaDeviceMemoryCallbacks() {
assert_eq!(
::std::mem::size_of::<VmaDeviceMemoryCallbacks>(),
24usize,
concat!("Size of: ", stringify!(VmaDeviceMemoryCallbacks))
);
assert_eq!(
::std::mem::align_of::<VmaDeviceMemoryCallbacks>(),
8usize,
concat!("Alignment of ", stringify!(VmaDeviceMemoryCallbacks))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDeviceMemoryCallbacks>())).pfnAllocate as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(VmaDeviceMemoryCallbacks),
"::",
stringify!(pfnAllocate)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDeviceMemoryCallbacks>())).pfnFree as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaDeviceMemoryCallbacks),
"::",
stringify!(pfnFree)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDeviceMemoryCallbacks>())).pUserData as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(VmaDeviceMemoryCallbacks),
"::",
stringify!(pUserData)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaAllocatorCreateFlagBits {
VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 1,
VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT = 2,
VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT = 4,
VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT = 8,
VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT = 16,
VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT = 32,
VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT = 64,
VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
pub type VmaAllocatorCreateFlags = VkFlags;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct VmaVulkanFunctions {
pub vkGetPhysicalDeviceProperties: PFN_vkGetPhysicalDeviceProperties,
pub vkGetPhysicalDeviceMemoryProperties: PFN_vkGetPhysicalDeviceMemoryProperties,
pub vkAllocateMemory: PFN_vkAllocateMemory,
pub vkFreeMemory: PFN_vkFreeMemory,
pub vkMapMemory: PFN_vkMapMemory,
pub vkUnmapMemory: PFN_vkUnmapMemory,
pub vkFlushMappedMemoryRanges: PFN_vkFlushMappedMemoryRanges,
pub vkInvalidateMappedMemoryRanges: PFN_vkInvalidateMappedMemoryRanges,
pub vkBindBufferMemory: PFN_vkBindBufferMemory,
pub vkBindImageMemory: PFN_vkBindImageMemory,
pub vkGetBufferMemoryRequirements: PFN_vkGetBufferMemoryRequirements,
pub vkGetImageMemoryRequirements: PFN_vkGetImageMemoryRequirements,
pub vkCreateBuffer: PFN_vkCreateBuffer,
pub vkDestroyBuffer: PFN_vkDestroyBuffer,
pub vkCreateImage: PFN_vkCreateImage,
pub vkDestroyImage: PFN_vkDestroyImage,
pub vkCmdCopyBuffer: PFN_vkCmdCopyBuffer,
pub vkGetBufferMemoryRequirements2KHR: PFN_vkGetBufferMemoryRequirements2KHR,
pub vkGetImageMemoryRequirements2KHR: PFN_vkGetImageMemoryRequirements2KHR,
pub vkBindBufferMemory2KHR: PFN_vkBindBufferMemory2KHR,
pub vkBindImageMemory2KHR: PFN_vkBindImageMemory2KHR,
pub vkGetPhysicalDeviceMemoryProperties2KHR: PFN_vkGetPhysicalDeviceMemoryProperties2KHR,
}
#[test]
fn bindgen_test_layout_VmaVulkanFunctions() {
assert_eq!(
::std::mem::size_of::<VmaVulkanFunctions>(),
176usize,
concat!("Size of: ", stringify!(VmaVulkanFunctions))
);
assert_eq!(
::std::mem::align_of::<VmaVulkanFunctions>(),
8usize,
concat!("Alignment of ", stringify!(VmaVulkanFunctions))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkGetPhysicalDeviceProperties as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkGetPhysicalDeviceProperties)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkGetPhysicalDeviceMemoryProperties
as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkGetPhysicalDeviceMemoryProperties)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkAllocateMemory as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkAllocateMemory)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaVulkanFunctions>())).vkFreeMemory as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkFreeMemory)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaVulkanFunctions>())).vkMapMemory as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkMapMemory)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkUnmapMemory as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkUnmapMemory)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkFlushMappedMemoryRanges as *const _
as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkFlushMappedMemoryRanges)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkInvalidateMappedMemoryRanges
as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkInvalidateMappedMemoryRanges)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkBindBufferMemory as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkBindBufferMemory)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkBindImageMemory as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkBindImageMemory)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkGetBufferMemoryRequirements as *const _
as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkGetBufferMemoryRequirements)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkGetImageMemoryRequirements as *const _
as usize
},
88usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkGetImageMemoryRequirements)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkCreateBuffer as *const _ as usize
},
96usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkCreateBuffer)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkDestroyBuffer as *const _ as usize
},
104usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkDestroyBuffer)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkCreateImage as *const _ as usize
},
112usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkCreateImage)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkDestroyImage as *const _ as usize
},
120usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkDestroyImage)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkCmdCopyBuffer as *const _ as usize
},
128usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkCmdCopyBuffer)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkGetBufferMemoryRequirements2KHR
as *const _ as usize
},
136usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkGetBufferMemoryRequirements2KHR)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkGetImageMemoryRequirements2KHR
as *const _ as usize
},
144usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkGetImageMemoryRequirements2KHR)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkBindBufferMemory2KHR as *const _
as usize
},
152usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkBindBufferMemory2KHR)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkBindImageMemory2KHR as *const _
as usize
},
160usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkBindImageMemory2KHR)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaVulkanFunctions>())).vkGetPhysicalDeviceMemoryProperties2KHR
as *const _ as usize
},
168usize,
concat!(
"Offset of field: ",
stringify!(VmaVulkanFunctions),
"::",
stringify!(vkGetPhysicalDeviceMemoryProperties2KHR)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaRecordFlagBits {
VMA_RECORD_FLUSH_AFTER_CALL_BIT = 1,
VMA_RECORD_FLAG_BITS_MAX_ENUM = 2147483647,
}
pub type VmaRecordFlags = VkFlags;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaRecordSettings {
pub flags: VmaRecordFlags,
pub pFilePath: *const ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_VmaRecordSettings() {
assert_eq!(
::std::mem::size_of::<VmaRecordSettings>(),
16usize,
concat!("Size of: ", stringify!(VmaRecordSettings))
);
assert_eq!(
::std::mem::align_of::<VmaRecordSettings>(),
8usize,
concat!("Alignment of ", stringify!(VmaRecordSettings))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaRecordSettings>())).flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaRecordSettings),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaRecordSettings>())).pFilePath as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(VmaRecordSettings),
"::",
stringify!(pFilePath)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocatorCreateInfo {
pub flags: VmaAllocatorCreateFlags,
pub physicalDevice: VkPhysicalDevice,
pub device: VkDevice,
pub preferredLargeHeapBlockSize: VkDeviceSize,
pub pAllocationCallbacks: *const VkAllocationCallbacks,
pub pDeviceMemoryCallbacks: *const VmaDeviceMemoryCallbacks,
pub frameInUseCount: u32,
pub pHeapSizeLimit: *const VkDeviceSize,
pub pVulkanFunctions: *const VmaVulkanFunctions,
pub pRecordSettings: *const VmaRecordSettings,
pub instance: VkInstance,
pub vulkanApiVersion: u32,
}
#[test]
fn bindgen_test_layout_VmaAllocatorCreateInfo() {
assert_eq!(
::std::mem::size_of::<VmaAllocatorCreateInfo>(),
96usize,
concat!("Size of: ", stringify!(VmaAllocatorCreateInfo))
);
assert_eq!(
::std::mem::align_of::<VmaAllocatorCreateInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaAllocatorCreateInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).physicalDevice as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(physicalDevice)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).device as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(device)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).preferredLargeHeapBlockSize
as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(preferredLargeHeapBlockSize)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).pAllocationCallbacks as *const _
as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(pAllocationCallbacks)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).pDeviceMemoryCallbacks as *const _
as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(pDeviceMemoryCallbacks)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).frameInUseCount as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(frameInUseCount)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).pHeapSizeLimit as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(pHeapSizeLimit)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).pVulkanFunctions as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(pVulkanFunctions)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).pRecordSettings as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(pRecordSettings)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).instance as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(instance)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocatorCreateInfo>())).vulkanApiVersion as *const _ as usize
},
88usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorCreateInfo),
"::",
stringify!(vulkanApiVersion)
)
);
}
extern "C" {
pub fn vmaCreateAllocator(
pCreateInfo: *const VmaAllocatorCreateInfo,
pAllocator: *mut VmaAllocator,
) -> VkResult;
}
extern "C" {
pub fn vmaDestroyAllocator(allocator: VmaAllocator);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocatorInfo {
pub instance: VkInstance,
pub physicalDevice: VkPhysicalDevice,
pub device: VkDevice,
}
#[test]
fn bindgen_test_layout_VmaAllocatorInfo() {
assert_eq!(
::std::mem::size_of::<VmaAllocatorInfo>(),
24usize,
concat!("Size of: ", stringify!(VmaAllocatorInfo))
);
assert_eq!(
::std::mem::align_of::<VmaAllocatorInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaAllocatorInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocatorInfo>())).instance as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorInfo),
"::",
stringify!(instance)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocatorInfo>())).physicalDevice as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorInfo),
"::",
stringify!(physicalDevice)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocatorInfo>())).device as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocatorInfo),
"::",
stringify!(device)
)
);
}
extern "C" {
pub fn vmaGetAllocatorInfo(allocator: VmaAllocator, pAllocatorInfo: *mut VmaAllocatorInfo);
}
extern "C" {
pub fn vmaGetPhysicalDeviceProperties(
allocator: VmaAllocator,
ppPhysicalDeviceProperties: *mut *const VkPhysicalDeviceProperties,
);
}
extern "C" {
pub fn vmaGetMemoryProperties(
allocator: VmaAllocator,
ppPhysicalDeviceMemoryProperties: *mut *const VkPhysicalDeviceMemoryProperties,
);
}
extern "C" {
pub fn vmaGetMemoryTypeProperties(
allocator: VmaAllocator,
memoryTypeIndex: u32,
pFlags: *mut VkMemoryPropertyFlags,
);
}
extern "C" {
pub fn vmaSetCurrentFrameIndex(allocator: VmaAllocator, frameIndex: u32);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaStatInfo {
pub blockCount: u32,
pub allocationCount: u32,
pub unusedRangeCount: u32,
pub usedBytes: VkDeviceSize,
pub unusedBytes: VkDeviceSize,
pub allocationSizeMin: VkDeviceSize,
pub allocationSizeAvg: VkDeviceSize,
pub allocationSizeMax: VkDeviceSize,
pub unusedRangeSizeMin: VkDeviceSize,
pub unusedRangeSizeAvg: VkDeviceSize,
pub unusedRangeSizeMax: VkDeviceSize,
}
#[test]
fn bindgen_test_layout_VmaStatInfo() {
assert_eq!(
::std::mem::size_of::<VmaStatInfo>(),
80usize,
concat!("Size of: ", stringify!(VmaStatInfo))
);
assert_eq!(
::std::mem::align_of::<VmaStatInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaStatInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).blockCount as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(blockCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).allocationCount as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(allocationCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).unusedRangeCount as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(unusedRangeCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).usedBytes as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(usedBytes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).unusedBytes as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(unusedBytes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).allocationSizeMin as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(allocationSizeMin)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).allocationSizeAvg as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(allocationSizeAvg)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).allocationSizeMax as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(allocationSizeMax)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).unusedRangeSizeMin as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(unusedRangeSizeMin)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).unusedRangeSizeAvg as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(unusedRangeSizeAvg)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStatInfo>())).unusedRangeSizeMax as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(VmaStatInfo),
"::",
stringify!(unusedRangeSizeMax)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaStats {
pub memoryType: [VmaStatInfo; 32usize],
pub memoryHeap: [VmaStatInfo; 16usize],
pub total: VmaStatInfo,
}
#[test]
fn bindgen_test_layout_VmaStats() {
assert_eq!(
::std::mem::size_of::<VmaStats>(),
3920usize,
concat!("Size of: ", stringify!(VmaStats))
);
assert_eq!(
::std::mem::align_of::<VmaStats>(),
8usize,
concat!("Alignment of ", stringify!(VmaStats))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStats>())).memoryType as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaStats),
"::",
stringify!(memoryType)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStats>())).memoryHeap as *const _ as usize },
2560usize,
concat!(
"Offset of field: ",
stringify!(VmaStats),
"::",
stringify!(memoryHeap)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaStats>())).total as *const _ as usize },
3840usize,
concat!(
"Offset of field: ",
stringify!(VmaStats),
"::",
stringify!(total)
)
);
}
extern "C" {
pub fn vmaCalculateStats(allocator: VmaAllocator, pStats: *mut VmaStats);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaBudget {
pub blockBytes: VkDeviceSize,
pub allocationBytes: VkDeviceSize,
pub usage: VkDeviceSize,
pub budget: VkDeviceSize,
}
#[test]
fn bindgen_test_layout_VmaBudget() {
assert_eq!(
::std::mem::size_of::<VmaBudget>(),
32usize,
concat!("Size of: ", stringify!(VmaBudget))
);
assert_eq!(
::std::mem::align_of::<VmaBudget>(),
8usize,
concat!("Alignment of ", stringify!(VmaBudget))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaBudget>())).blockBytes as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaBudget),
"::",
stringify!(blockBytes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaBudget>())).allocationBytes as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(VmaBudget),
"::",
stringify!(allocationBytes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaBudget>())).usage as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(VmaBudget),
"::",
stringify!(usage)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaBudget>())).budget as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(VmaBudget),
"::",
stringify!(budget)
)
);
}
extern "C" {
pub fn vmaGetBudget(allocator: VmaAllocator, pBudget: *mut VmaBudget);
}
extern "C" {
pub fn vmaBuildStatsString(
allocator: VmaAllocator,
ppStatsString: *mut *mut ::std::os::raw::c_char,
detailedMap: VkBool32,
);
}
extern "C" {
pub fn vmaFreeStatsString(allocator: VmaAllocator, pStatsString: *mut ::std::os::raw::c_char);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaPool_T {
_unused: [u8; 0],
}
pub type VmaPool = *mut VmaPool_T;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaMemoryUsage {
VMA_MEMORY_USAGE_UNKNOWN = 0,
VMA_MEMORY_USAGE_GPU_ONLY = 1,
VMA_MEMORY_USAGE_CPU_ONLY = 2,
VMA_MEMORY_USAGE_CPU_TO_GPU = 3,
VMA_MEMORY_USAGE_GPU_TO_CPU = 4,
VMA_MEMORY_USAGE_CPU_COPY = 5,
VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED = 6,
VMA_MEMORY_USAGE_MAX_ENUM = 2147483647,
}
impl VmaAllocationCreateFlagBits {
pub const VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT: VmaAllocationCreateFlagBits =
VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT;
}
impl VmaAllocationCreateFlagBits {
pub const VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT: VmaAllocationCreateFlagBits =
VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT;
}
impl VmaAllocationCreateFlagBits {
pub const VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT: VmaAllocationCreateFlagBits =
VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaAllocationCreateFlagBits {
VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 1,
VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 2,
VMA_ALLOCATION_CREATE_MAPPED_BIT = 4,
VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT = 8,
VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT = 16,
VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 32,
VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 64,
VMA_ALLOCATION_CREATE_DONT_BIND_BIT = 128,
VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT = 256,
VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT = 65536,
VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT = 131072,
VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT = 262144,
VMA_ALLOCATION_CREATE_STRATEGY_MASK = 458752,
VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
pub type VmaAllocationCreateFlags = VkFlags;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocationCreateInfo {
pub flags: VmaAllocationCreateFlags,
pub usage: VmaMemoryUsage,
pub requiredFlags: VkMemoryPropertyFlagBits,
pub preferredFlags: VkMemoryPropertyFlagBits,
pub memoryTypeBits: u32,
pub pool: VmaPool,
pub pUserData: *mut ::std::os::raw::c_void,
pub priority: f32,
}
#[test]
fn bindgen_test_layout_VmaAllocationCreateInfo() {
assert_eq!(
::std::mem::size_of::<VmaAllocationCreateInfo>(),
48usize,
concat!("Size of: ", stringify!(VmaAllocationCreateInfo))
);
assert_eq!(
::std::mem::align_of::<VmaAllocationCreateInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaAllocationCreateInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationCreateInfo>())).flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationCreateInfo>())).usage as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(usage)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocationCreateInfo>())).requiredFlags as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(requiredFlags)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocationCreateInfo>())).preferredFlags as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(preferredFlags)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocationCreateInfo>())).memoryTypeBits as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(memoryTypeBits)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationCreateInfo>())).pool as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(pool)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocationCreateInfo>())).pUserData as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(pUserData)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaAllocationCreateInfo>())).priority as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationCreateInfo),
"::",
stringify!(priority)
)
);
}
extern "C" {
pub fn vmaFindMemoryTypeIndex(
allocator: VmaAllocator,
memoryTypeBits: u32,
pAllocationCreateInfo: *const VmaAllocationCreateInfo,
pMemoryTypeIndex: *mut u32,
) -> VkResult;
}
extern "C" {
pub fn vmaFindMemoryTypeIndexForBufferInfo(
allocator: VmaAllocator,
pBufferCreateInfo: *const VkBufferCreateInfo,
pAllocationCreateInfo: *const VmaAllocationCreateInfo,
pMemoryTypeIndex: *mut u32,
) -> VkResult;
}
extern "C" {
pub fn vmaFindMemoryTypeIndexForImageInfo(
allocator: VmaAllocator,
pImageCreateInfo: *const VkImageCreateInfo,
pAllocationCreateInfo: *const VmaAllocationCreateInfo,
pMemoryTypeIndex: *mut u32,
) -> VkResult;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaPoolCreateFlagBits {
VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 2,
VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 4,
VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT = 8,
VMA_POOL_CREATE_ALGORITHM_MASK = 12,
VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
pub type VmaPoolCreateFlags = VkFlags;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaPoolCreateInfo {
pub memoryTypeIndex: u32,
pub flags: VmaPoolCreateFlags,
pub blockSize: VkDeviceSize,
pub minBlockCount: isize,
pub maxBlockCount: isize,
pub frameInUseCount: u32,
pub priority: f32,
}
#[test]
fn bindgen_test_layout_VmaPoolCreateInfo() {
assert_eq!(
::std::mem::size_of::<VmaPoolCreateInfo>(),
40usize,
concat!("Size of: ", stringify!(VmaPoolCreateInfo))
);
assert_eq!(
::std::mem::align_of::<VmaPoolCreateInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaPoolCreateInfo))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaPoolCreateInfo>())).memoryTypeIndex as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolCreateInfo),
"::",
stringify!(memoryTypeIndex)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolCreateInfo>())).flags as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolCreateInfo),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolCreateInfo>())).blockSize as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolCreateInfo),
"::",
stringify!(blockSize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolCreateInfo>())).minBlockCount as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolCreateInfo),
"::",
stringify!(minBlockCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolCreateInfo>())).maxBlockCount as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolCreateInfo),
"::",
stringify!(maxBlockCount)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaPoolCreateInfo>())).frameInUseCount as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolCreateInfo),
"::",
stringify!(frameInUseCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolCreateInfo>())).priority as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolCreateInfo),
"::",
stringify!(priority)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaPoolStats {
pub size: VkDeviceSize,
pub unusedSize: VkDeviceSize,
pub allocationCount: isize,
pub unusedRangeCount: isize,
pub unusedRangeSizeMax: VkDeviceSize,
pub blockCount: isize,
}
#[test]
fn bindgen_test_layout_VmaPoolStats() {
assert_eq!(
::std::mem::size_of::<VmaPoolStats>(),
48usize,
concat!("Size of: ", stringify!(VmaPoolStats))
);
assert_eq!(
::std::mem::align_of::<VmaPoolStats>(),
8usize,
concat!("Alignment of ", stringify!(VmaPoolStats))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolStats>())).size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolStats),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolStats>())).unusedSize as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolStats),
"::",
stringify!(unusedSize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolStats>())).allocationCount as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolStats),
"::",
stringify!(allocationCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolStats>())).unusedRangeCount as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolStats),
"::",
stringify!(unusedRangeCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolStats>())).unusedRangeSizeMax as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolStats),
"::",
stringify!(unusedRangeSizeMax)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaPoolStats>())).blockCount as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(VmaPoolStats),
"::",
stringify!(blockCount)
)
);
}
extern "C" {
pub fn vmaCreatePool(
allocator: VmaAllocator,
pCreateInfo: *const VmaPoolCreateInfo,
pPool: *mut VmaPool,
) -> VkResult;
}
extern "C" {
pub fn vmaDestroyPool(allocator: VmaAllocator, pool: VmaPool);
}
extern "C" {
pub fn vmaGetPoolStats(allocator: VmaAllocator, pool: VmaPool, pPoolStats: *mut VmaPoolStats);
}
extern "C" {
pub fn vmaMakePoolAllocationsLost(
allocator: VmaAllocator,
pool: VmaPool,
pLostAllocationCount: *mut isize,
);
}
extern "C" {
pub fn vmaCheckPoolCorruption(allocator: VmaAllocator, pool: VmaPool) -> VkResult;
}
extern "C" {
pub fn vmaGetPoolName(
allocator: VmaAllocator,
pool: VmaPool,
ppName: *mut *const ::std::os::raw::c_char,
);
}
extern "C" {
pub fn vmaSetPoolName(
allocator: VmaAllocator,
pool: VmaPool,
pName: *const ::std::os::raw::c_char,
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocation_T {
_unused: [u8; 0],
}
pub type VmaAllocation = *mut VmaAllocation_T;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocationInfo {
pub memoryType: u32,
pub deviceMemory: VkDeviceMemory,
pub offset: VkDeviceSize,
pub size: VkDeviceSize,
pub pMappedData: *mut ::std::os::raw::c_void,
pub pUserData: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout_VmaAllocationInfo() {
assert_eq!(
::std::mem::size_of::<VmaAllocationInfo>(),
48usize,
concat!("Size of: ", stringify!(VmaAllocationInfo))
);
assert_eq!(
::std::mem::align_of::<VmaAllocationInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaAllocationInfo))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationInfo>())).memoryType as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationInfo),
"::",
stringify!(memoryType)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationInfo>())).deviceMemory as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationInfo),
"::",
stringify!(deviceMemory)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationInfo>())).offset as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationInfo),
"::",
stringify!(offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationInfo>())).size as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationInfo),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationInfo>())).pMappedData as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationInfo),
"::",
stringify!(pMappedData)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaAllocationInfo>())).pUserData as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(VmaAllocationInfo),
"::",
stringify!(pUserData)
)
);
}
extern "C" {
pub fn vmaAllocateMemory(
allocator: VmaAllocator,
pVkMemoryRequirements: *const VkMemoryRequirements,
pCreateInfo: *const VmaAllocationCreateInfo,
pAllocation: *mut VmaAllocation,
pAllocationInfo: *mut VmaAllocationInfo,
) -> VkResult;
}
extern "C" {
pub fn vmaAllocateMemoryPages(
allocator: VmaAllocator,
pVkMemoryRequirements: *const VkMemoryRequirements,
pCreateInfo: *const VmaAllocationCreateInfo,
allocationCount: isize,
pAllocations: *mut VmaAllocation,
pAllocationInfo: *mut VmaAllocationInfo,
) -> VkResult;
}
extern "C" {
pub fn vmaAllocateMemoryForBuffer(
allocator: VmaAllocator,
buffer: VkBuffer,
pCreateInfo: *const VmaAllocationCreateInfo,
pAllocation: *mut VmaAllocation,
pAllocationInfo: *mut VmaAllocationInfo,
) -> VkResult;
}
extern "C" {
pub fn vmaAllocateMemoryForImage(
allocator: VmaAllocator,
image: VkImage,
pCreateInfo: *const VmaAllocationCreateInfo,
pAllocation: *mut VmaAllocation,
pAllocationInfo: *mut VmaAllocationInfo,
) -> VkResult;
}
extern "C" {
pub fn vmaFreeMemory(allocator: VmaAllocator, allocation: VmaAllocation);
}
extern "C" {
pub fn vmaFreeMemoryPages(
allocator: VmaAllocator,
allocationCount: isize,
pAllocations: *mut VmaAllocation,
);
}
extern "C" {
pub fn vmaResizeAllocation(
allocator: VmaAllocator,
allocation: VmaAllocation,
newSize: VkDeviceSize,
) -> VkResult;
}
extern "C" {
pub fn vmaGetAllocationInfo(
allocator: VmaAllocator,
allocation: VmaAllocation,
pAllocationInfo: *mut VmaAllocationInfo,
);
}
extern "C" {
pub fn vmaTouchAllocation(allocator: VmaAllocator, allocation: VmaAllocation) -> VkBool32;
}
extern "C" {
pub fn vmaSetAllocationUserData(
allocator: VmaAllocator,
allocation: VmaAllocation,
pUserData: *mut ::std::os::raw::c_void,
);
}
extern "C" {
pub fn vmaCreateLostAllocation(allocator: VmaAllocator, pAllocation: *mut VmaAllocation);
}
extern "C" {
pub fn vmaMapMemory(
allocator: VmaAllocator,
allocation: VmaAllocation,
ppData: *mut *mut ::std::os::raw::c_void,
) -> VkResult;
}
extern "C" {
pub fn vmaUnmapMemory(allocator: VmaAllocator, allocation: VmaAllocation);
}
extern "C" {
pub fn vmaFlushAllocation(
allocator: VmaAllocator,
allocation: VmaAllocation,
offset: VkDeviceSize,
size: VkDeviceSize,
) -> VkResult;
}
extern "C" {
pub fn vmaInvalidateAllocation(
allocator: VmaAllocator,
allocation: VmaAllocation,
offset: VkDeviceSize,
size: VkDeviceSize,
) -> VkResult;
}
extern "C" {
pub fn vmaFlushAllocations(
allocator: VmaAllocator,
allocationCount: u32,
allocations: *mut VmaAllocation,
offsets: *const VkDeviceSize,
sizes: *const VkDeviceSize,
) -> VkResult;
}
extern "C" {
pub fn vmaInvalidateAllocations(
allocator: VmaAllocator,
allocationCount: u32,
allocations: *mut VmaAllocation,
offsets: *const VkDeviceSize,
sizes: *const VkDeviceSize,
) -> VkResult;
}
extern "C" {
pub fn vmaCheckCorruption(allocator: VmaAllocator, memoryTypeBits: u32) -> VkResult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationContext_T {
_unused: [u8; 0],
}
pub type VmaDefragmentationContext = *mut VmaDefragmentationContext_T;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaDefragmentationFlagBits {
VMA_DEFRAGMENTATION_FLAG_INCREMENTAL = 1,
VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM = 2147483647,
}
pub type VmaDefragmentationFlags = VkFlags;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationInfo2 {
pub flags: VmaDefragmentationFlags,
pub allocationCount: u32,
pub pAllocations: *mut VmaAllocation,
pub pAllocationsChanged: *mut VkBool32,
pub poolCount: u32,
pub pPools: *mut VmaPool,
pub maxCpuBytesToMove: VkDeviceSize,
pub maxCpuAllocationsToMove: u32,
pub maxGpuBytesToMove: VkDeviceSize,
pub maxGpuAllocationsToMove: u32,
pub commandBuffer: VkCommandBuffer,
}
#[test]
fn bindgen_test_layout_VmaDefragmentationInfo2() {
assert_eq!(
::std::mem::size_of::<VmaDefragmentationInfo2>(),
80usize,
concat!("Size of: ", stringify!(VmaDefragmentationInfo2))
);
assert_eq!(
::std::mem::align_of::<VmaDefragmentationInfo2>(),
8usize,
concat!("Alignment of ", stringify!(VmaDefragmentationInfo2))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaDefragmentationInfo2>())).flags as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).allocationCount as *const _ as usize
},
4usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(allocationCount)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).pAllocations as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(pAllocations)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).pAllocationsChanged as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(pAllocationsChanged)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).poolCount as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(poolCount)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<VmaDefragmentationInfo2>())).pPools as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(pPools)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).maxCpuBytesToMove as *const _
as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(maxCpuBytesToMove)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).maxCpuAllocationsToMove as *const _
as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(maxCpuAllocationsToMove)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).maxGpuBytesToMove as *const _
as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(maxGpuBytesToMove)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).maxGpuAllocationsToMove as *const _
as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(maxGpuAllocationsToMove)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo2>())).commandBuffer as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo2),
"::",
stringify!(commandBuffer)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationPassMoveInfo {
pub allocation: VmaAllocation,
pub memory: VkDeviceMemory,
pub offset: VkDeviceSize,
}
#[test]
fn bindgen_test_layout_VmaDefragmentationPassMoveInfo() {
assert_eq!(
::std::mem::size_of::<VmaDefragmentationPassMoveInfo>(),
24usize,
concat!("Size of: ", stringify!(VmaDefragmentationPassMoveInfo))
);
assert_eq!(
::std::mem::align_of::<VmaDefragmentationPassMoveInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaDefragmentationPassMoveInfo))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationPassMoveInfo>())).allocation as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationPassMoveInfo),
"::",
stringify!(allocation)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationPassMoveInfo>())).memory as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationPassMoveInfo),
"::",
stringify!(memory)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationPassMoveInfo>())).offset as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationPassMoveInfo),
"::",
stringify!(offset)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationPassInfo {
pub moveCount: u32,
pub pMoves: *mut VmaDefragmentationPassMoveInfo,
}
#[test]
fn bindgen_test_layout_VmaDefragmentationPassInfo() {
assert_eq!(
::std::mem::size_of::<VmaDefragmentationPassInfo>(),
16usize,
concat!("Size of: ", stringify!(VmaDefragmentationPassInfo))
);
assert_eq!(
::std::mem::align_of::<VmaDefragmentationPassInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaDefragmentationPassInfo))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationPassInfo>())).moveCount as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationPassInfo),
"::",
stringify!(moveCount)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationPassInfo>())).pMoves as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationPassInfo),
"::",
stringify!(pMoves)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationInfo {
pub maxBytesToMove: VkDeviceSize,
pub maxAllocationsToMove: u32,
}
#[test]
fn bindgen_test_layout_VmaDefragmentationInfo() {
assert_eq!(
::std::mem::size_of::<VmaDefragmentationInfo>(),
16usize,
concat!("Size of: ", stringify!(VmaDefragmentationInfo))
);
assert_eq!(
::std::mem::align_of::<VmaDefragmentationInfo>(),
8usize,
concat!("Alignment of ", stringify!(VmaDefragmentationInfo))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo>())).maxBytesToMove as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo),
"::",
stringify!(maxBytesToMove)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationInfo>())).maxAllocationsToMove as *const _
as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationInfo),
"::",
stringify!(maxAllocationsToMove)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationStats {
pub bytesMoved: VkDeviceSize,
pub bytesFreed: VkDeviceSize,
pub allocationsMoved: u32,
pub deviceMemoryBlocksFreed: u32,
}
#[test]
fn bindgen_test_layout_VmaDefragmentationStats() {
assert_eq!(
::std::mem::size_of::<VmaDefragmentationStats>(),
24usize,
concat!("Size of: ", stringify!(VmaDefragmentationStats))
);
assert_eq!(
::std::mem::align_of::<VmaDefragmentationStats>(),
8usize,
concat!("Alignment of ", stringify!(VmaDefragmentationStats))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationStats>())).bytesMoved as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationStats),
"::",
stringify!(bytesMoved)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationStats>())).bytesFreed as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationStats),
"::",
stringify!(bytesFreed)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationStats>())).allocationsMoved as *const _
as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationStats),
"::",
stringify!(allocationsMoved)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<VmaDefragmentationStats>())).deviceMemoryBlocksFreed as *const _
as usize
},
20usize,
concat!(
"Offset of field: ",
stringify!(VmaDefragmentationStats),
"::",
stringify!(deviceMemoryBlocksFreed)
)
);
}
extern "C" {
pub fn vmaDefragmentationBegin(
allocator: VmaAllocator,
pInfo: *const VmaDefragmentationInfo2,
pStats: *mut VmaDefragmentationStats,
pContext: *mut VmaDefragmentationContext,
) -> VkResult;
}
extern "C" {
pub fn vmaDefragmentationEnd(
allocator: VmaAllocator,
context: VmaDefragmentationContext,
) -> VkResult;
}
extern "C" {
pub fn vmaBeginDefragmentationPass(
allocator: VmaAllocator,
context: VmaDefragmentationContext,
pInfo: *mut VmaDefragmentationPassInfo,
) -> VkResult;
}
extern "C" {
pub fn vmaEndDefragmentationPass(
allocator: VmaAllocator,
context: VmaDefragmentationContext,
) -> VkResult;
}
extern "C" {
pub fn vmaDefragment(
allocator: VmaAllocator,
pAllocations: *mut VmaAllocation,
allocationCount: isize,
pAllocationsChanged: *mut VkBool32,
pDefragmentationInfo: *const VmaDefragmentationInfo,
pDefragmentationStats: *mut VmaDefragmentationStats,
) -> VkResult;
}
extern "C" {
pub fn vmaBindBufferMemory(
allocator: VmaAllocator,
allocation: VmaAllocation,
buffer: VkBuffer,
) -> VkResult;
}
extern "C" {
pub fn vmaBindBufferMemory2(
allocator: VmaAllocator,
allocation: VmaAllocation,
allocationLocalOffset: VkDeviceSize,
buffer: VkBuffer,
pNext: *const ::std::os::raw::c_void,
) -> VkResult;
}
extern "C" {
pub fn vmaBindImageMemory(
allocator: VmaAllocator,
allocation: VmaAllocation,
image: VkImage,
) -> VkResult;
}
extern "C" {
pub fn vmaBindImageMemory2(
allocator: VmaAllocator,
allocation: VmaAllocation,
allocationLocalOffset: VkDeviceSize,
image: VkImage,
pNext: *const ::std::os::raw::c_void,
) -> VkResult;
}
extern "C" {
pub fn vmaCreateBuffer(
allocator: VmaAllocator,
pBufferCreateInfo: *const VkBufferCreateInfo,
pAllocationCreateInfo: *const VmaAllocationCreateInfo,
pBuffer: *mut VkBuffer,
pAllocation: *mut VmaAllocation,
pAllocationInfo: *mut VmaAllocationInfo,
) -> VkResult;
}
extern "C" {
pub fn vmaDestroyBuffer(allocator: VmaAllocator, buffer: VkBuffer, allocation: VmaAllocation);
}
extern "C" {
pub fn vmaCreateImage(
allocator: VmaAllocator,
pImageCreateInfo: *const VkImageCreateInfo,
pAllocationCreateInfo: *const VmaAllocationCreateInfo,
pImage: *mut VkImage,
pAllocation: *mut VmaAllocation,
pAllocationInfo: *mut VmaAllocationInfo,
) -> VkResult;
}
extern "C" {
pub fn vmaDestroyImage(allocator: VmaAllocator, image: VkImage, allocation: VmaAllocation);
}