Skip to content

Commit 1fbe0d3

Browse files
committed
fmt & better comments
1 parent 5cb4e4d commit 1fbe0d3

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/lib.rs

+17-13
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,27 @@ extern crate ash;
1414

1515
#[cfg(feature = "vulkan")]
1616
use ash::vk::{
17-
Device as VkDevice, Format as VkFormat, Image as VkImage,
18-
ImageCreateFlags as VkImageCreateFlags, ImageTiling as VkImageTiling,
19-
ImageUsageFlags as VkImageUsageFlagBits, Instance as VkInstance, PFN_vkGetInstanceProcAddr,
20-
PhysicalDevice as VkPhysicalDevice,
21-
DeviceMemory as VkDeviceMemory,
22-
MemoryPropertyFlags as VkMemoryPropertyFlagBits,
23-
AccessFlags as VkAccessFlagBits,
24-
ImageLayout as VkImageLayout,
25-
Semaphore as VkSemaphore,
26-
QueueFlags as VkQueueFlagBits,
27-
VideoCodecOperationFlagsKHR as VkVideoCodecOperationFlagBitsKHR
17+
AccessFlags as VkAccessFlagBits, Device as VkDevice, DeviceMemory as VkDeviceMemory,
18+
Format as VkFormat, Image as VkImage, ImageCreateFlags as VkImageCreateFlags,
19+
ImageLayout as VkImageLayout, ImageTiling as VkImageTiling,
20+
ImageUsageFlags as VkImageUsageFlagBits, Instance as VkInstance,
21+
MemoryPropertyFlags as VkMemoryPropertyFlagBits, PFN_vkGetInstanceProcAddr,
22+
PhysicalDevice as VkPhysicalDevice, QueueFlags as VkQueueFlagBits, Semaphore as VkSemaphore,
23+
VideoCodecOperationFlagsKHR as VkVideoCodecOperationFlagBitsKHR,
2824
};
2925

26+
// the generated bindgen structs need these types that have lifetimes in them,
27+
// but there is no way within bindgen to propagate those lifetimes out into the structs
28+
// that contain these structs
29+
//
30+
// so, just put 'static to let it compile. Making sure the lifetimes are actually
31+
// check out nicely is now part of the checks an author must do when using the unsafe
32+
// functions that take in these structs or any other structs that contain them.
33+
3034
#[cfg(feature = "vulkan")]
31-
type VkAllocationCallbacks = ash::vk::AllocationCallbacks<'static>; // hack!
35+
type VkAllocationCallbacks = ash::vk::AllocationCallbacks<'static>;
3236
#[cfg(feature = "vulkan")]
33-
type VkPhysicalDeviceFeatures2 = ash::vk::PhysicalDeviceFeatures2<'static>; // hack!
37+
type VkPhysicalDeviceFeatures2 = ash::vk::PhysicalDeviceFeatures2<'static>;
3438

3539
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
3640

0 commit comments

Comments
 (0)