Skip to content

Commit

Permalink
Globally remove all allow(dead_code) exceptions and make extensions p…
Browse files Browse the repository at this point in the history
…ublic (#430)

* GetPhysicalDeviceProperties2: Make API functions public

Fixes: 5eb39fe ("Add VK_KHR_get_physical_device_properties2 extension (#400)")

* BufferDeviceAddress: Make API functions public

Fixes: 98d66c6 ("Add VK_KHR/EXT_buffer_device_address extension (#405)")

* GetMemoryRequirements2: Make API functions public

Fixes: d8d7423 ("Add VK_KHR_get_memory_requirements2 extension (#401)")

* Maintenance1/Maintenance3: Make API functions public

Fixes: a0a1f5d ("Add VK_KHR_maintenance extensions (#406)")

* Globally remove all `allow(dead_code)` exceptions

This is hiding the fact that some extension functions are inadvertently
not public and hence unusable by crate users, nor does it enforce clean
coding practices.

In addition remove `ash/src/allocator.rs` which does not appear to be
used (anymore?) and isn't in a working state anyway.
  • Loading branch information
MarijnS95 authored May 8, 2021
1 parent c7216f1 commit 28b6253
Show file tree
Hide file tree
Showing 37 changed files with 19 additions and 175 deletions.
120 changes: 0 additions & 120 deletions ash/src/allocator.rs

This file was deleted.

3 changes: 1 addition & 2 deletions ash/src/extensions/ext/buffer_device_address.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
Expand All @@ -22,7 +21,7 @@ impl BufferDeviceAddress {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddressEXT.html>"]
unsafe fn get_buffer_device_address(
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoEXT,
) -> vk::DeviceAddress {
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/ext/debug_marker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::{Device, Instance};
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/ext/debug_report.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/ext/debug_utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::{vk, RawPtr};
use crate::{EntryCustom, Instance};
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/ext/extended_dynamic_state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/ext/full_screen_exclusive.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::{Device, Instance};
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/ext/metal_surface.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/ext/tooling_info.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::{EntryCustom, Instance};
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/acceleration_structure.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/android_surface.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
Expand Down
7 changes: 3 additions & 4 deletions ash/src/extensions/khr/buffer_device_address.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
Expand All @@ -22,15 +21,15 @@ impl BufferDeviceAddress {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddressKHR.html>"]
unsafe fn get_buffer_device_address(
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR,
) -> vk::DeviceAddress {
self.fns.get_buffer_device_address_khr(self.handle, info)
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html>"]
unsafe fn get_buffer_opaque_capture_address(
pub unsafe fn get_buffer_opaque_capture_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR,
) -> u64 {
Expand All @@ -39,7 +38,7 @@ impl BufferDeviceAddress {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddressKHR.html>"]
unsafe fn get_device_memory_opaque_capture_address(
pub unsafe fn get_device_memory_opaque_capture_address(
&self,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR,
) -> u64 {
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/create_render_pass2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/deferred_host_operations.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/display_swapchain.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/draw_indirect_count.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
Expand Down
9 changes: 4 additions & 5 deletions ash/src/extensions/khr/get_memory_requirements2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
Expand Down Expand Up @@ -27,7 +26,7 @@ impl GetMemoryRequirements2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferMemoryRequirements2KHR.html>"]
unsafe fn get_buffer_memory_requirements2(
pub unsafe fn get_buffer_memory_requirements2(
&self,
info: &vk::BufferMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
Expand All @@ -37,7 +36,7 @@ impl GetMemoryRequirements2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageMemoryRequirements2KHR.html>"]
unsafe fn get_image_memory_requirements2(
pub unsafe fn get_image_memory_requirements2(
&self,
info: &vk::ImageMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
Expand All @@ -46,7 +45,7 @@ impl GetMemoryRequirements2 {
.get_image_memory_requirements2_khr(self.handle, info, memory_requirements);
}

unsafe fn get_image_sparse_memory_requirements2_len(
pub unsafe fn get_image_sparse_memory_requirements2_len(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
) -> usize {
Expand All @@ -62,7 +61,7 @@ impl GetMemoryRequirements2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2KHR.html>"]
unsafe fn get_image_sparse_memory_requirements2(
pub unsafe fn get_image_sparse_memory_requirements2(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
sparse_memory_requirements: &mut [vk::SparseImageMemoryRequirements2KHR],
Expand Down
19 changes: 9 additions & 10 deletions ash/src/extensions/khr/get_physical_device_properties2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::{EntryCustom, Instance};
Expand Down Expand Up @@ -29,7 +28,7 @@ impl GetPhysicalDeviceProperties2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFeatures2KHR.html>"]
unsafe fn get_physical_device_features2(
pub unsafe fn get_physical_device_features2(
&self,
physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2KHR,
Expand All @@ -39,7 +38,7 @@ impl GetPhysicalDeviceProperties2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceFormatProperties2KHR.html>"]
unsafe fn get_physical_device_format_properties2(
pub unsafe fn get_physical_device_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format: vk::Format,
Expand All @@ -50,7 +49,7 @@ impl GetPhysicalDeviceProperties2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2KHR.html>"]
unsafe fn get_physical_device_image_format_properties2(
pub unsafe fn get_physical_device_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR,
Expand All @@ -66,7 +65,7 @@ impl GetPhysicalDeviceProperties2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2KHR.html>"]
unsafe fn get_physical_device_memory_properties2(
pub unsafe fn get_physical_device_memory_properties2(
&self,
physical_device: vk::PhysicalDevice,
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR,
Expand All @@ -76,7 +75,7 @@ impl GetPhysicalDeviceProperties2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceProperties2KHR.html>"]
unsafe fn get_physical_device_properties2(
pub unsafe fn get_physical_device_properties2(
&self,
physical_device: vk::PhysicalDevice,
properties: &mut vk::PhysicalDeviceProperties2KHR,
Expand All @@ -85,7 +84,7 @@ impl GetPhysicalDeviceProperties2 {
.get_physical_device_properties2_khr(physical_device, properties);
}

unsafe fn get_physical_device_queue_family_properties2_len(
pub unsafe fn get_physical_device_queue_family_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
) -> usize {
Expand All @@ -100,7 +99,7 @@ impl GetPhysicalDeviceProperties2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2KHR.html>"]
unsafe fn get_physical_device_queue_family_properties2(
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
physical_device: vk::PhysicalDevice,
queue_family_properties: &mut [vk::QueueFamilyProperties2KHR],
Expand All @@ -114,7 +113,7 @@ impl GetPhysicalDeviceProperties2 {
);
}

unsafe fn get_physical_device_sparse_image_format_properties2_len(
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
Expand All @@ -131,7 +130,7 @@ impl GetPhysicalDeviceProperties2 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2KHR.html>"]
unsafe fn get_physical_device_sparse_image_format_properties2(
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
Expand Down
3 changes: 1 addition & 2 deletions ash/src/extensions/khr/maintenance1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
Expand Down Expand Up @@ -26,7 +25,7 @@ impl Maintenance1 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkTrimCommandPoolKHR.html>"]
unsafe fn trim_command_pool(
pub unsafe fn trim_command_pool(
&self,
command_pool: vk::CommandPool,
flags: vk::CommandPoolTrimFlagsKHR,
Expand Down
3 changes: 1 addition & 2 deletions ash/src/extensions/khr/maintenance3.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::CStr;
Expand Down Expand Up @@ -26,7 +25,7 @@ impl Maintenance3 {
}

#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDescriptorSetLayoutSupportKHR.html>"]
unsafe fn get_descriptor_set_layout_support(
pub unsafe fn get_descriptor_set_layout_support(
&self,
create_info: &vk::DescriptorSetLayoutCreateInfo,
out: &mut vk::DescriptorSetLayoutSupportKHR,
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/pipeline_executable_properties.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::prelude::*;
use crate::vk;
use crate::{EntryCustom, Instance};
Expand Down
1 change: 0 additions & 1 deletion ash/src/extensions/khr/push_descriptor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::vk;
use crate::{Device, Instance};
use std::ffi::c_void;
Expand Down
Loading

0 comments on commit 28b6253

Please sign in to comment.