Mark some more functions as unsafe

This commit is contained in:
Tim 2018-08-03 12:51:03 +02:00
parent 59d49b2159
commit cda39148e9
2 changed files with 67 additions and 79 deletions

View file

@ -34,13 +34,12 @@ pub trait DeviceV1_1: DeviceV1_0 {
}
}
fn get_device_group_peer_memory_features(
unsafe fn get_device_group_peer_memory_features(
&self,
heap_index: vk::uint32_t,
local_device_index: vk::uint32_t,
remote_device_index: vk::uint32_t,
) -> vk::PeerMemoryFeatureFlags {
unsafe {
let mut peer_memory_features = mem::uninitialized();
self.fp_v1_1().get_device_group_peer_memory_features(
self.handle(),
@ -51,7 +50,6 @@ pub trait DeviceV1_1: DeviceV1_0 {
);
peer_memory_features
}
}
unsafe fn cmd_set_device_mask(
&self,

View file

@ -145,12 +145,11 @@ pub trait InstanceV1_1: InstanceV1_0 {
}
}
fn get_physical_device_image_format_properties2(
unsafe fn get_physical_device_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceImageFormatInfo2,
) -> VkResult<vk::ImageFormatProperties2> {
unsafe {
let mut image_format_prop = mem::uninitialized();
let err_code = self.fp_v1_1().get_physical_device_image_format_properties2(
physical_device,
@ -163,7 +162,6 @@ pub trait InstanceV1_1: InstanceV1_0 {
Err(err_code)
}
}
}
fn get_physical_device_queue_family_properties2(
&self,
@ -199,12 +197,11 @@ pub trait InstanceV1_1: InstanceV1_0 {
}
}
fn get_physical_device_sparse_image_format_properties2(
unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2,
) -> Vec<vk::SparseImageFormatProperties2> {
unsafe {
let mut format_count = 0;
self.fp_v1_1()
.get_physical_device_sparse_image_format_properties2(
@ -224,14 +221,12 @@ pub trait InstanceV1_1: InstanceV1_0 {
format_prop.set_len(format_count as usize);
format_prop
}
}
fn get_physical_device_external_buffer_properties(
unsafe fn get_physical_device_external_buffer_properties(
&self,
physical_device: vk::PhysicalDevice,
external_buffer_info: &vk::PhysicalDeviceExternalBufferInfo,
) -> vk::ExternalBufferProperties {
unsafe {
let mut image_format_prop = mem::uninitialized();
self.fp_v1_1()
.get_physical_device_external_buffer_properties(
@ -241,14 +236,12 @@ pub trait InstanceV1_1: InstanceV1_0 {
);
image_format_prop
}
}
fn get_physical_device_external_fence_properties(
unsafe fn get_physical_device_external_fence_properties(
&self,
physical_device: vk::PhysicalDevice,
external_fence_info: &vk::PhysicalDeviceExternalFenceInfo,
) -> vk::ExternalFenceProperties {
unsafe {
let mut fence_prop = mem::uninitialized();
self.fp_v1_1()
.get_physical_device_external_fence_properties(
@ -258,14 +251,12 @@ pub trait InstanceV1_1: InstanceV1_0 {
);
fence_prop
}
}
fn get_physical_device_external_semaphore_properties(
unsafe fn get_physical_device_external_semaphore_properties(
&self,
physical_device: vk::PhysicalDevice,
external_semaphore_info: &vk::PhysicalDeviceExternalSemaphoreInfo,
) -> vk::ExternalSemaphoreProperties {
unsafe {
let mut semaphore_prop = mem::uninitialized();
self.fp_v1_1()
.get_physical_device_external_semaphore_properties(
@ -276,7 +267,6 @@ pub trait InstanceV1_1: InstanceV1_0 {
semaphore_prop
}
}
}
#[allow(non_camel_case_types)]
pub trait InstanceV1_0 {