Merge pull request #167 from MaikKlein/vendor-names
Move extensions into vendor specific modules
This commit is contained in:
commit
a0588c399a
|
@ -24,7 +24,7 @@ impl DebugMarker {
|
||||||
CStr::from_bytes_with_nul(b"VK_EXT_debug_marker\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_EXT_debug_marker\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn debug_marker_set_object_name_ext(
|
pub unsafe fn debug_marker_set_object_name(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
device: vk::Device,
|
||||||
name_info: &vk::DebugMarkerObjectNameInfoEXT,
|
name_info: &vk::DebugMarkerObjectNameInfoEXT,
|
||||||
|
@ -38,7 +38,7 @@ impl DebugMarker {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn cmd_debug_marker_begin_ext(
|
pub unsafe fn cmd_debug_marker_begin(
|
||||||
&self,
|
&self,
|
||||||
command_buffer: vk::CommandBuffer,
|
command_buffer: vk::CommandBuffer,
|
||||||
marker_info: &vk::DebugMarkerMarkerInfoEXT,
|
marker_info: &vk::DebugMarkerMarkerInfoEXT,
|
||||||
|
@ -47,12 +47,12 @@ impl DebugMarker {
|
||||||
.cmd_debug_marker_begin_ext(command_buffer, marker_info);
|
.cmd_debug_marker_begin_ext(command_buffer, marker_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn cmd_debug_marker_end_ext(&self, command_buffer: vk::CommandBuffer) {
|
pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) {
|
||||||
self.debug_marker_fn
|
self.debug_marker_fn
|
||||||
.cmd_debug_marker_end_ext(command_buffer);
|
.cmd_debug_marker_end_ext(command_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn cmd_debug_marker_insert_ext(
|
pub unsafe fn cmd_debug_marker_insert(
|
||||||
&self,
|
&self,
|
||||||
command_buffer: vk::CommandBuffer,
|
command_buffer: vk::CommandBuffer,
|
||||||
marker_info: &vk::DebugMarkerMarkerInfoEXT,
|
marker_info: &vk::DebugMarkerMarkerInfoEXT,
|
|
@ -27,7 +27,7 @@ impl DebugReport {
|
||||||
CStr::from_bytes_with_nul(b"VK_EXT_debug_report\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_EXT_debug_report\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn destroy_debug_report_callback_ext(
|
pub unsafe fn destroy_debug_report_callback(
|
||||||
&self,
|
&self,
|
||||||
debug: vk::DebugReportCallbackEXT,
|
debug: vk::DebugReportCallbackEXT,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||||
|
@ -39,7 +39,7 @@ impl DebugReport {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_debug_report_callback_ext(
|
pub unsafe fn create_debug_report_callback(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::DebugReportCallbackCreateInfoEXT,
|
create_info: &vk::DebugReportCallbackCreateInfoEXT,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
|
@ -26,7 +26,7 @@ impl DebugUtils {
|
||||||
CStr::from_bytes_with_nul(b"VK_EXT_debug_utils\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_EXT_debug_utils\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn debug_utils_set_object_name_ext(
|
pub unsafe fn debug_utils_set_object_name(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
device: vk::Device,
|
||||||
name_info: &vk::DebugUtilsObjectNameInfoEXT,
|
name_info: &vk::DebugUtilsObjectNameInfoEXT,
|
||||||
|
@ -40,7 +40,7 @@ impl DebugUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn debug_utils_set_object_tag_ext(
|
pub unsafe fn debug_utils_set_object_tag(
|
||||||
&self,
|
&self,
|
||||||
device: vk::Device,
|
device: vk::Device,
|
||||||
tag_info: &vk::DebugUtilsObjectTagInfoEXT,
|
tag_info: &vk::DebugUtilsObjectTagInfoEXT,
|
||||||
|
@ -54,7 +54,7 @@ impl DebugUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn cmd_begin_debug_utils_label_ext(
|
pub unsafe fn cmd_begin_debug_utils_label(
|
||||||
&self,
|
&self,
|
||||||
command_buffer: vk::CommandBuffer,
|
command_buffer: vk::CommandBuffer,
|
||||||
label: &vk::DebugUtilsLabelEXT,
|
label: &vk::DebugUtilsLabelEXT,
|
||||||
|
@ -63,12 +63,12 @@ impl DebugUtils {
|
||||||
.cmd_begin_debug_utils_label_ext(command_buffer, label);
|
.cmd_begin_debug_utils_label_ext(command_buffer, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn cmd_end_debug_utils_label_ext(&self, command_buffer: vk::CommandBuffer) {
|
pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) {
|
||||||
self.debug_utils_fn
|
self.debug_utils_fn
|
||||||
.cmd_end_debug_utils_label_ext(command_buffer);
|
.cmd_end_debug_utils_label_ext(command_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn cmd_insert_debug_utils_label_ext(
|
pub unsafe fn cmd_insert_debug_utils_label(
|
||||||
&self,
|
&self,
|
||||||
command_buffer: vk::CommandBuffer,
|
command_buffer: vk::CommandBuffer,
|
||||||
label: &vk::DebugUtilsLabelEXT,
|
label: &vk::DebugUtilsLabelEXT,
|
||||||
|
@ -77,7 +77,7 @@ impl DebugUtils {
|
||||||
.cmd_insert_debug_utils_label_ext(command_buffer, label);
|
.cmd_insert_debug_utils_label_ext(command_buffer, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn queue_begin_debug_utils_label_ext(
|
pub unsafe fn queue_begin_debug_utils_label(
|
||||||
&self,
|
&self,
|
||||||
queue: vk::Queue,
|
queue: vk::Queue,
|
||||||
label: &vk::DebugUtilsLabelEXT,
|
label: &vk::DebugUtilsLabelEXT,
|
||||||
|
@ -86,11 +86,11 @@ impl DebugUtils {
|
||||||
.queue_begin_debug_utils_label_ext(queue, label);
|
.queue_begin_debug_utils_label_ext(queue, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn queue_end_debug_utils_label_ext(&self, queue: vk::Queue) {
|
pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) {
|
||||||
self.debug_utils_fn.queue_end_debug_utils_label_ext(queue);
|
self.debug_utils_fn.queue_end_debug_utils_label_ext(queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn queue_insert_debug_utils_label_ext(
|
pub unsafe fn queue_insert_debug_utils_label(
|
||||||
&self,
|
&self,
|
||||||
queue: vk::Queue,
|
queue: vk::Queue,
|
||||||
label: &vk::DebugUtilsLabelEXT,
|
label: &vk::DebugUtilsLabelEXT,
|
||||||
|
@ -99,7 +99,7 @@ impl DebugUtils {
|
||||||
.queue_insert_debug_utils_label_ext(queue, label);
|
.queue_insert_debug_utils_label_ext(queue, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_debug_utils_messenger_ext(
|
pub unsafe fn create_debug_utils_messenger(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::DebugUtilsMessengerCreateInfoEXT,
|
create_info: &vk::DebugUtilsMessengerCreateInfoEXT,
|
||||||
allocator: Option<&vk::AllocationCallbacks>,
|
allocator: Option<&vk::AllocationCallbacks>,
|
||||||
|
@ -117,7 +117,7 @@ impl DebugUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn destroy_debug_utils_messenger_ext(
|
pub unsafe fn destroy_debug_utils_messenger(
|
||||||
&self,
|
&self,
|
||||||
messenger: vk::DebugUtilsMessengerEXT,
|
messenger: vk::DebugUtilsMessengerEXT,
|
||||||
allocator: Option<&vk::AllocationCallbacks>,
|
allocator: Option<&vk::AllocationCallbacks>,
|
||||||
|
@ -129,7 +129,7 @@ impl DebugUtils {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn submit_debug_utils_message_ext(
|
pub unsafe fn submit_debug_utils_message(
|
||||||
&self,
|
&self,
|
||||||
instance: vk::Instance,
|
instance: vk::Instance,
|
||||||
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
|
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
|
7
ash/src/extensions/ext/mod.rs
Normal file
7
ash/src/extensions/ext/mod.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
pub use self::debug_marker::DebugMarker;
|
||||||
|
pub use self::debug_report::DebugReport;
|
||||||
|
pub use self::debug_utils::DebugUtils;
|
||||||
|
|
||||||
|
mod debug_marker;
|
||||||
|
mod debug_report;
|
||||||
|
mod debug_utils;
|
|
@ -27,7 +27,7 @@ impl AndroidSurface {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_android_surface\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_android_surface\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_android_surface_khr(
|
pub unsafe fn create_android_surface(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::AndroidSurfaceCreateInfoKHR,
|
create_info: &vk::AndroidSurfaceCreateInfoKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
|
@ -27,7 +27,7 @@ impl DisplaySwapchain {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_display_swapchain\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_display_swapchain\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_shared_swapchains_khr(
|
pub unsafe fn create_shared_swapchains(
|
||||||
&self,
|
&self,
|
||||||
create_infos: &[vk::SwapchainCreateInfoKHR],
|
create_infos: &[vk::SwapchainCreateInfoKHR],
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
17
ash/src/extensions/khr/mod.rs
Normal file
17
ash/src/extensions/khr/mod.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
pub use self::android_surface::AndroidSurface;
|
||||||
|
pub use self::display_swapchain::DisplaySwapchain;
|
||||||
|
pub use self::surface::Surface;
|
||||||
|
pub use self::swapchain::Swapchain;
|
||||||
|
pub use self::wayland_surface::WaylandSurface;
|
||||||
|
pub use self::win32_surface::Win32Surface;
|
||||||
|
pub use self::xcb_surface::XcbSurface;
|
||||||
|
pub use self::xlib_surface::XlibSurface;
|
||||||
|
|
||||||
|
mod android_surface;
|
||||||
|
mod display_swapchain;
|
||||||
|
mod surface;
|
||||||
|
mod swapchain;
|
||||||
|
mod wayland_surface;
|
||||||
|
mod win32_surface;
|
||||||
|
mod xcb_surface;
|
||||||
|
mod xlib_surface;
|
|
@ -28,7 +28,7 @@ impl Surface {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_surface\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_surface\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn get_physical_device_surface_support_khr(
|
pub unsafe fn get_physical_device_surface_support(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
queue_index: u32,
|
queue_index: u32,
|
||||||
|
@ -44,7 +44,7 @@ impl Surface {
|
||||||
b > 0
|
b > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn get_physical_device_surface_present_modes_khr(
|
pub unsafe fn get_physical_device_surface_present_modes(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
surface: vk::SurfaceKHR,
|
surface: vk::SurfaceKHR,
|
||||||
|
@ -73,7 +73,7 @@ impl Surface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn get_physical_device_surface_capabilities_khr(
|
pub unsafe fn get_physical_device_surface_capabilities(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
surface: vk::SurfaceKHR,
|
surface: vk::SurfaceKHR,
|
||||||
|
@ -92,7 +92,7 @@ impl Surface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn get_physical_device_surface_formats_khr(
|
pub unsafe fn get_physical_device_surface_formats(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
surface: vk::SurfaceKHR,
|
surface: vk::SurfaceKHR,
|
||||||
|
@ -118,7 +118,7 @@ impl Surface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn destroy_surface_khr(
|
pub unsafe fn destroy_surface(
|
||||||
&self,
|
&self,
|
||||||
surface: vk::SurfaceKHR,
|
surface: vk::SurfaceKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
|
@ -28,7 +28,7 @@ impl Swapchain {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_swapchain\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_swapchain\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn destroy_swapchain_khr(
|
pub unsafe fn destroy_swapchain(
|
||||||
&self,
|
&self,
|
||||||
swapchain: vk::SwapchainKHR,
|
swapchain: vk::SwapchainKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||||
|
@ -41,7 +41,7 @@ impl Swapchain {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
|
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
|
||||||
pub unsafe fn acquire_next_image_khr(
|
pub unsafe fn acquire_next_image(
|
||||||
&self,
|
&self,
|
||||||
swapchain: vk::SwapchainKHR,
|
swapchain: vk::SwapchainKHR,
|
||||||
timeout: u64,
|
timeout: u64,
|
||||||
|
@ -64,7 +64,7 @@ impl Swapchain {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_swapchain_khr(
|
pub unsafe fn create_swapchain(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::SwapchainCreateInfoKHR,
|
create_info: &vk::SwapchainCreateInfoKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||||
|
@ -83,7 +83,7 @@ impl Swapchain {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// On success, returns whether the swapchain is suboptimal for the surface.
|
/// On success, returns whether the swapchain is suboptimal for the surface.
|
||||||
pub unsafe fn queue_present_khr(
|
pub unsafe fn queue_present(
|
||||||
&self,
|
&self,
|
||||||
queue: vk::Queue,
|
queue: vk::Queue,
|
||||||
create_info: &vk::PresentInfoKHR,
|
create_info: &vk::PresentInfoKHR,
|
||||||
|
@ -96,7 +96,7 @@ impl Swapchain {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn get_swapchain_images_khr(
|
pub unsafe fn get_swapchain_images(
|
||||||
&self,
|
&self,
|
||||||
swapchain: vk::SwapchainKHR,
|
swapchain: vk::SwapchainKHR,
|
||||||
) -> VkResult<Vec<vk::Image>> {
|
) -> VkResult<Vec<vk::Image>> {
|
|
@ -27,7 +27,7 @@ impl WaylandSurface {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_wayland_surface\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_wayland_surface\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_wayland_surface_khr(
|
pub unsafe fn create_wayland_surface(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::WaylandSurfaceCreateInfoKHR,
|
create_info: &vk::WaylandSurfaceCreateInfoKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
|
@ -27,7 +27,7 @@ impl Win32Surface {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_win32_surface\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_win32_surface\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_win32_surface_khr(
|
pub unsafe fn create_win32_surface(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::Win32SurfaceCreateInfoKHR,
|
create_info: &vk::Win32SurfaceCreateInfoKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
|
@ -27,7 +27,7 @@ impl XcbSurface {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_xcb_surface\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_xcb_surface\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_xcb_surface_khr(
|
pub unsafe fn create_xcb_surface(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::XcbSurfaceCreateInfoKHR,
|
create_info: &vk::XcbSurfaceCreateInfoKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
|
@ -27,7 +27,7 @@ impl XlibSurface {
|
||||||
CStr::from_bytes_with_nul(b"VK_KHR_xlib_surface\0").expect("Wrong extension string")
|
CStr::from_bytes_with_nul(b"VK_KHR_xlib_surface\0").expect("Wrong extension string")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn create_xlib_surface_khr(
|
pub unsafe fn create_xlib_surface(
|
||||||
&self,
|
&self,
|
||||||
create_info: &vk::XlibSurfaceCreateInfoKHR,
|
create_info: &vk::XlibSurfaceCreateInfoKHR,
|
||||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
|
@ -1,29 +1,4 @@
|
||||||
pub use self::android_surface::AndroidSurface;
|
pub mod ext;
|
||||||
pub use self::debug_marker::DebugMarker;
|
pub mod khr;
|
||||||
pub use self::debug_report::DebugReport;
|
pub mod mvk;
|
||||||
pub use self::debug_utils::DebugUtils;
|
pub mod nv;
|
||||||
pub use self::display_swapchain::DisplaySwapchain;
|
|
||||||
pub use self::ios_surface::IOSSurface;
|
|
||||||
pub use self::macos_surface::MacOSSurface;
|
|
||||||
pub use self::mesh_shader::MeshShader;
|
|
||||||
pub use self::surface::Surface;
|
|
||||||
pub use self::swapchain::Swapchain;
|
|
||||||
pub use self::wayland_surface::WaylandSurface;
|
|
||||||
pub use self::win32_surface::Win32Surface;
|
|
||||||
pub use self::xcb_surface::XcbSurface;
|
|
||||||
pub use self::xlib_surface::XlibSurface;
|
|
||||||
|
|
||||||
mod android_surface;
|
|
||||||
mod debug_marker;
|
|
||||||
mod debug_report;
|
|
||||||
mod debug_utils;
|
|
||||||
mod display_swapchain;
|
|
||||||
mod ios_surface;
|
|
||||||
mod macos_surface;
|
|
||||||
mod mesh_shader;
|
|
||||||
mod surface;
|
|
||||||
mod swapchain;
|
|
||||||
mod wayland_surface;
|
|
||||||
mod win32_surface;
|
|
||||||
mod xcb_surface;
|
|
||||||
mod xlib_surface;
|
|
||||||
|
|
5
ash/src/extensions/mvk/mod.rs
Normal file
5
ash/src/extensions/mvk/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pub use self::ios_surface::IOSSurface;
|
||||||
|
pub use self::macos_surface::MacOSSurface;
|
||||||
|
|
||||||
|
mod ios_surface;
|
||||||
|
mod macos_surface;
|
|
@ -16,7 +16,7 @@ impl MeshShader {
|
||||||
});
|
});
|
||||||
MeshShader { mesh_shader_fn }
|
MeshShader { mesh_shader_fn }
|
||||||
}
|
}
|
||||||
pub unsafe fn cmd_draw_mesh_tasks_nv(
|
pub unsafe fn cmd_draw_mesh_tasks(
|
||||||
&self,
|
&self,
|
||||||
command_buffer: vk::CommandBuffer,
|
command_buffer: vk::CommandBuffer,
|
||||||
task_count: u32,
|
task_count: u32,
|
||||||
|
@ -25,7 +25,7 @@ impl MeshShader {
|
||||||
self.mesh_shader_fn
|
self.mesh_shader_fn
|
||||||
.cmd_draw_mesh_tasks_nv(command_buffer, task_count, first_task);
|
.cmd_draw_mesh_tasks_nv(command_buffer, task_count, first_task);
|
||||||
}
|
}
|
||||||
pub unsafe fn cmd_draw_mesh_tasks_indirect_nv(
|
pub unsafe fn cmd_draw_mesh_tasks_indirect(
|
||||||
&self,
|
&self,
|
||||||
command_buffer: vk::CommandBuffer,
|
command_buffer: vk::CommandBuffer,
|
||||||
buffer: vk::Buffer,
|
buffer: vk::Buffer,
|
||||||
|
@ -41,7 +41,7 @@ impl MeshShader {
|
||||||
stride,
|
stride,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
pub unsafe fn cmd_draw_mesh_tasks_indirect_count_nv(
|
pub unsafe fn cmd_draw_mesh_tasks_indirect_count(
|
||||||
&self,
|
&self,
|
||||||
command_buffer: vk::CommandBuffer,
|
command_buffer: vk::CommandBuffer,
|
||||||
buffer: vk::Buffer,
|
buffer: vk::Buffer,
|
3
ash/src/extensions/nv/mod.rs
Normal file
3
ash/src/extensions/nv/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
pub use self::mesh_shader::MeshShader;
|
||||||
|
|
||||||
|
mod mesh_shader;
|
|
@ -867,7 +867,7 @@ fn main() {
|
||||||
base.render_loop(|| {
|
base.render_loop(|| {
|
||||||
let (present_index, _) = base
|
let (present_index, _) = base
|
||||||
.swapchain_loader
|
.swapchain_loader
|
||||||
.acquire_next_image_khr(
|
.acquire_next_image(
|
||||||
base.swapchain,
|
base.swapchain,
|
||||||
std::u64::MAX,
|
std::u64::MAX,
|
||||||
base.present_complete_semaphore,
|
base.present_complete_semaphore,
|
||||||
|
@ -964,7 +964,7 @@ fn main() {
|
||||||
p_results: ptr::null_mut(),
|
p_results: ptr::null_mut(),
|
||||||
};
|
};
|
||||||
base.swapchain_loader
|
base.swapchain_loader
|
||||||
.queue_present_khr(base.present_queue, &present_info)
|
.queue_present(base.present_queue, &present_info)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
});
|
});
|
||||||
base.device.device_wait_idle().unwrap();
|
base.device.device_wait_idle().unwrap();
|
||||||
|
|
|
@ -457,7 +457,7 @@ fn main() {
|
||||||
base.render_loop(|| {
|
base.render_loop(|| {
|
||||||
let (present_index, _) = base
|
let (present_index, _) = base
|
||||||
.swapchain_loader
|
.swapchain_loader
|
||||||
.acquire_next_image_khr(
|
.acquire_next_image(
|
||||||
base.swapchain,
|
base.swapchain,
|
||||||
std::u64::MAX,
|
std::u64::MAX,
|
||||||
base.present_complete_semaphore,
|
base.present_complete_semaphore,
|
||||||
|
@ -546,7 +546,7 @@ fn main() {
|
||||||
p_results: ptr::null_mut(),
|
p_results: ptr::null_mut(),
|
||||||
};
|
};
|
||||||
base.swapchain_loader
|
base.swapchain_loader
|
||||||
.queue_present_khr(base.present_queue, &present_info)
|
.queue_present(base.present_queue, &present_info)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -21,18 +21,19 @@ use objc::runtime::YES;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
|
||||||
use ash::extensions::MacOSSurface;
|
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
use ash::extensions::Win32Surface;
|
|
||||||
#[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))]
|
||||||
use ash::extensions::XlibSurface;
|
use ash::extensions::khr::XlibSurface;
|
||||||
use ash::extensions::{DebugReport, Surface, Swapchain};
|
use ash::extensions::{
|
||||||
|
ext::DebugReport,
|
||||||
|
khr::{Surface, Swapchain},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
use ash::extensions::khr::Win32Surface;
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
use ash::extensions::mvk::MacOSSurface;
|
||||||
pub use ash::version::{DeviceV1_0, EntryV1_0, InstanceV1_0};
|
pub use ash::version::{DeviceV1_0, EntryV1_0, InstanceV1_0};
|
||||||
use ash::vk;
|
use ash::{vk, Device, Entry, Instance};
|
||||||
use ash::Device;
|
|
||||||
use ash::Entry;
|
|
||||||
use ash::Instance;
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::ffi::{CStr, CString};
|
use std::ffi::{CStr, CString};
|
||||||
|
@ -126,7 +127,7 @@ unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>(
|
||||||
dpy: x11_display as *mut vk::Display,
|
dpy: x11_display as *mut vk::Display,
|
||||||
};
|
};
|
||||||
let xlib_surface_loader = XlibSurface::new(entry, instance);
|
let xlib_surface_loader = XlibSurface::new(entry, instance);
|
||||||
xlib_surface_loader.create_xlib_surface_khr(&x11_create_info, None)
|
xlib_surface_loader.create_xlib_surface(&x11_create_info, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
@ -182,7 +183,7 @@ unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>(
|
||||||
hwnd: hwnd as *const c_void,
|
hwnd: hwnd as *const c_void,
|
||||||
};
|
};
|
||||||
let win32_surface_loader = Win32Surface::new(entry, instance);
|
let win32_surface_loader = Win32Surface::new(entry, instance);
|
||||||
win32_surface_loader.create_win32_surface_khr(&win32_create_info, None)
|
win32_surface_loader.create_win32_surface(&win32_create_info, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))]
|
||||||
|
@ -375,7 +376,7 @@ impl ExampleBase {
|
||||||
};
|
};
|
||||||
let debug_report_loader = DebugReport::new(&entry, &instance);
|
let debug_report_loader = DebugReport::new(&entry, &instance);
|
||||||
let debug_call_back = debug_report_loader
|
let debug_call_back = debug_report_loader
|
||||||
.create_debug_report_callback_ext(&debug_info, None)
|
.create_debug_report_callback(&debug_info, None)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let surface = create_surface(&entry, &instance, &window).unwrap();
|
let surface = create_surface(&entry, &instance, &window).unwrap();
|
||||||
let pdevices = instance
|
let pdevices = instance
|
||||||
|
@ -392,7 +393,7 @@ impl ExampleBase {
|
||||||
.filter_map(|(index, ref info)| {
|
.filter_map(|(index, ref info)| {
|
||||||
let supports_graphic_and_surface =
|
let supports_graphic_and_surface =
|
||||||
info.queue_flags.contains(vk::QueueFlags::GRAPHICS)
|
info.queue_flags.contains(vk::QueueFlags::GRAPHICS)
|
||||||
&& surface_loader.get_physical_device_surface_support_khr(
|
&& surface_loader.get_physical_device_surface_support(
|
||||||
*pdevice,
|
*pdevice,
|
||||||
index as u32,
|
index as u32,
|
||||||
surface,
|
surface,
|
||||||
|
@ -438,7 +439,7 @@ impl ExampleBase {
|
||||||
let present_queue = device.get_device_queue(queue_family_index as u32, 0);
|
let present_queue = device.get_device_queue(queue_family_index as u32, 0);
|
||||||
|
|
||||||
let surface_formats = surface_loader
|
let surface_formats = surface_loader
|
||||||
.get_physical_device_surface_formats_khr(pdevice, surface)
|
.get_physical_device_surface_formats(pdevice, surface)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let surface_format = surface_formats
|
let surface_format = surface_formats
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -451,7 +452,7 @@ impl ExampleBase {
|
||||||
}).nth(0)
|
}).nth(0)
|
||||||
.expect("Unable to find suitable surface format.");
|
.expect("Unable to find suitable surface format.");
|
||||||
let surface_capabilities = surface_loader
|
let surface_capabilities = surface_loader
|
||||||
.get_physical_device_surface_capabilities_khr(pdevice, surface)
|
.get_physical_device_surface_capabilities(pdevice, surface)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let mut desired_image_count = surface_capabilities.min_image_count + 1;
|
let mut desired_image_count = surface_capabilities.min_image_count + 1;
|
||||||
if surface_capabilities.max_image_count > 0
|
if surface_capabilities.max_image_count > 0
|
||||||
|
@ -475,7 +476,7 @@ impl ExampleBase {
|
||||||
surface_capabilities.current_transform
|
surface_capabilities.current_transform
|
||||||
};
|
};
|
||||||
let present_modes = surface_loader
|
let present_modes = surface_loader
|
||||||
.get_physical_device_surface_present_modes_khr(pdevice, surface)
|
.get_physical_device_surface_present_modes(pdevice, surface)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let present_mode = present_modes
|
let present_mode = present_modes
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -504,7 +505,7 @@ impl ExampleBase {
|
||||||
queue_family_index_count: 0,
|
queue_family_index_count: 0,
|
||||||
};
|
};
|
||||||
let swapchain = swapchain_loader
|
let swapchain = swapchain_loader
|
||||||
.create_swapchain_khr(&swapchain_create_info, None)
|
.create_swapchain(&swapchain_create_info, None)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let pool_create_info = vk::CommandPoolCreateInfo {
|
let pool_create_info = vk::CommandPoolCreateInfo {
|
||||||
s_type: vk::StructureType::COMMAND_POOL_CREATE_INFO,
|
s_type: vk::StructureType::COMMAND_POOL_CREATE_INFO,
|
||||||
|
@ -526,9 +527,7 @@ impl ExampleBase {
|
||||||
let setup_command_buffer = command_buffers[0];
|
let setup_command_buffer = command_buffers[0];
|
||||||
let draw_command_buffer = command_buffers[1];
|
let draw_command_buffer = command_buffers[1];
|
||||||
|
|
||||||
let present_images = swapchain_loader
|
let present_images = swapchain_loader.get_swapchain_images(swapchain).unwrap();
|
||||||
.get_swapchain_images_khr(swapchain)
|
|
||||||
.unwrap();
|
|
||||||
let present_image_views: Vec<vk::ImageView> = present_images
|
let present_image_views: Vec<vk::ImageView> = present_images
|
||||||
.iter()
|
.iter()
|
||||||
.map(|&image| {
|
.map(|&image| {
|
||||||
|
@ -719,11 +718,11 @@ impl Drop for ExampleBase {
|
||||||
}
|
}
|
||||||
self.device.destroy_command_pool(self.pool, None);
|
self.device.destroy_command_pool(self.pool, None);
|
||||||
self.swapchain_loader
|
self.swapchain_loader
|
||||||
.destroy_swapchain_khr(self.swapchain, None);
|
.destroy_swapchain(self.swapchain, None);
|
||||||
self.device.destroy_device(None);
|
self.device.destroy_device(None);
|
||||||
self.surface_loader.destroy_surface_khr(self.surface, None);
|
self.surface_loader.destroy_surface(self.surface, None);
|
||||||
self.debug_report_loader
|
self.debug_report_loader
|
||||||
.destroy_debug_report_callback_ext(self.debug_call_back, None);
|
.destroy_debug_report_callback(self.debug_call_back, None);
|
||||||
self.instance.destroy_instance(None);
|
self.instance.destroy_instance(None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue