From b989c4e0c25f7d4cf17ab97b845e2e9b7ac33bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Petter=20Sk=C3=A5lerud?= Date: Wed, 28 Aug 2019 19:36:32 +0200 Subject: [PATCH] Implemented interface for exposing raw function pointers in extensions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nils Petter Skålerud --- ash/src/extensions/ext/debug_marker.rs | 4 ++++ ash/src/extensions/ext/debug_report.rs | 8 ++++++++ ash/src/extensions/ext/debug_utils.rs | 8 ++++++++ ash/src/extensions/khr/android_surface.rs | 8 ++++++++ ash/src/extensions/khr/display_swapchain.rs | 8 ++++++++ ash/src/extensions/khr/surface.rs | 4 ++-- ash/src/extensions/khr/swapchain.rs | 4 ++-- ash/src/extensions/khr/wayland_surface.rs | 8 ++++++++ ash/src/extensions/khr/win32_surface.rs | 8 ++++++++ ash/src/extensions/khr/xcb_surface.rs | 8 ++++++++ ash/src/extensions/khr/xlib_surface.rs | 8 ++++++++ ash/src/extensions/mvk/ios_surface.rs | 8 ++++++++ ash/src/extensions/mvk/macos_surface.rs | 8 ++++++++ ash/src/extensions/nv/mesh_shader.rs | 4 ++++ ash/src/extensions/nv/ray_tracing.rs | 8 ++++++++ 15 files changed, 100 insertions(+), 4 deletions(-) mode change 100644 => 100755 ash/src/extensions/ext/debug_marker.rs mode change 100644 => 100755 ash/src/extensions/ext/debug_report.rs mode change 100644 => 100755 ash/src/extensions/ext/debug_utils.rs mode change 100644 => 100755 ash/src/extensions/khr/android_surface.rs mode change 100644 => 100755 ash/src/extensions/khr/display_swapchain.rs mode change 100644 => 100755 ash/src/extensions/khr/surface.rs mode change 100644 => 100755 ash/src/extensions/khr/swapchain.rs mode change 100644 => 100755 ash/src/extensions/khr/wayland_surface.rs mode change 100644 => 100755 ash/src/extensions/khr/win32_surface.rs mode change 100644 => 100755 ash/src/extensions/khr/xcb_surface.rs mode change 100644 => 100755 ash/src/extensions/khr/xlib_surface.rs mode change 100644 => 100755 ash/src/extensions/mvk/ios_surface.rs mode change 100644 => 100755 ash/src/extensions/mvk/macos_surface.rs mode change 100644 => 100755 ash/src/extensions/nv/mesh_shader.rs mode change 100644 => 100755 ash/src/extensions/nv/ray_tracing.rs diff --git a/ash/src/extensions/ext/debug_marker.rs b/ash/src/extensions/ext/debug_marker.rs old mode 100644 new mode 100755 index eeead34..ae81e2b --- a/ash/src/extensions/ext/debug_marker.rs +++ b/ash/src/extensions/ext/debug_marker.rs @@ -64,4 +64,8 @@ impl DebugMarker { self.debug_marker_fn .cmd_debug_marker_insert_ext(command_buffer, marker_info); } + + pub fn fp(&self) -> &vk::ExtDebugMarkerFn { + &self.debug_marker_fn + } } diff --git a/ash/src/extensions/ext/debug_report.rs b/ash/src/extensions/ext/debug_report.rs old mode 100644 new mode 100755 index 153c036..3235a7d --- a/ash/src/extensions/ext/debug_report.rs +++ b/ash/src/extensions/ext/debug_report.rs @@ -58,4 +58,12 @@ impl DebugReport { _ => Err(err_code), } } + + pub fn fp(&self) -> &vk::ExtDebugReportFn { + &self.debug_report_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/ext/debug_utils.rs b/ash/src/extensions/ext/debug_utils.rs old mode 100644 new mode 100755 index 01c04b5..0314505 --- a/ash/src/extensions/ext/debug_utils.rs +++ b/ash/src/extensions/ext/debug_utils.rs @@ -154,4 +154,12 @@ impl DebugUtils { callback_data, ); } + + pub fn fp(&self) -> &vk::ExtDebugUtilsFn { + &self.debug_utils_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/khr/android_surface.rs b/ash/src/extensions/khr/android_surface.rs old mode 100644 new mode 100755 index fcf5daa..ec9fb0a --- a/ash/src/extensions/khr/android_surface.rs +++ b/ash/src/extensions/khr/android_surface.rs @@ -45,4 +45,12 @@ impl AndroidSurface { _ => Err(err_code), } } + + pub fn fp(&self) -> &vk::KhrAndroidSurfaceFn { + &self.android_surface_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/khr/display_swapchain.rs b/ash/src/extensions/khr/display_swapchain.rs old mode 100644 new mode 100755 index c11690b..63ad488 --- a/ash/src/extensions/khr/display_swapchain.rs +++ b/ash/src/extensions/khr/display_swapchain.rs @@ -47,4 +47,12 @@ impl DisplaySwapchain { _ => Err(err_code), } } + + pub fn fp(&self) -> &vk::KhrDisplaySwapchainFn { + &self.swapchain_fn + } + + pub fn device(&self) -> vk::Device { + self.handle + } } diff --git a/ash/src/extensions/khr/surface.rs b/ash/src/extensions/khr/surface.rs old mode 100644 new mode 100755 index c0e6441..56cc481 --- a/ash/src/extensions/khr/surface.rs +++ b/ash/src/extensions/khr/surface.rs @@ -139,11 +139,11 @@ impl Surface { ); } - pub fn raw_fp(&self) -> &vk::KhrSurfaceFn { + pub fn fp(&self) -> &vk::KhrSurfaceFn { &self.surface_fn } - pub fn instance_handle(&self) -> vk::Instance { + pub fn instance(&self) -> vk::Instance { self.handle } } diff --git a/ash/src/extensions/khr/swapchain.rs b/ash/src/extensions/khr/swapchain.rs old mode 100644 new mode 100755 index f87ab95..eb6bc90 --- a/ash/src/extensions/khr/swapchain.rs +++ b/ash/src/extensions/khr/swapchain.rs @@ -127,11 +127,11 @@ impl Swapchain { } } - pub fn raw_fp(&self) -> &vk::KhrSwapchainFn { + pub fn fp(&self) -> &vk::KhrSwapchainFn { &self.swapchain_fn } - pub fn device_handle(&self) -> vk::Device { + pub fn device(&self) -> vk::Device { self.handle } } diff --git a/ash/src/extensions/khr/wayland_surface.rs b/ash/src/extensions/khr/wayland_surface.rs old mode 100644 new mode 100755 index 4707178..3a22b1d --- a/ash/src/extensions/khr/wayland_surface.rs +++ b/ash/src/extensions/khr/wayland_surface.rs @@ -63,4 +63,12 @@ impl WaylandSurface { b > 0 } + + pub fn fp(&self) -> &vk::KhrWaylandSurfaceFn { + &self.wayland_surface_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/khr/win32_surface.rs b/ash/src/extensions/khr/win32_surface.rs old mode 100644 new mode 100755 index aed6dfb..f041e87 --- a/ash/src/extensions/khr/win32_surface.rs +++ b/ash/src/extensions/khr/win32_surface.rs @@ -61,4 +61,12 @@ impl Win32Surface { b > 0 } + + pub fn fp(&self) -> &vk::KhrWin32SurfaceFn { + &self.win32_surface_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/khr/xcb_surface.rs b/ash/src/extensions/khr/xcb_surface.rs old mode 100644 new mode 100755 index 7a36607..4bd53e6 --- a/ash/src/extensions/khr/xcb_surface.rs +++ b/ash/src/extensions/khr/xcb_surface.rs @@ -65,4 +65,12 @@ impl XcbSurface { b > 0 } + + pub fn fp(&self) -> &vk::KhrXcbSurfaceFn { + &self.xcb_surface_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/khr/xlib_surface.rs b/ash/src/extensions/khr/xlib_surface.rs old mode 100644 new mode 100755 index 24f4d2c..fda08e6 --- a/ash/src/extensions/khr/xlib_surface.rs +++ b/ash/src/extensions/khr/xlib_surface.rs @@ -65,4 +65,12 @@ impl XlibSurface { b > 0 } + + pub fn fp(&self) -> &vk::KhrXlibSurfaceFn { + &self.xlib_surface_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/mvk/ios_surface.rs b/ash/src/extensions/mvk/ios_surface.rs old mode 100644 new mode 100755 index 4100c2d..86e079a --- a/ash/src/extensions/mvk/ios_surface.rs +++ b/ash/src/extensions/mvk/ios_surface.rs @@ -45,4 +45,12 @@ impl IOSSurface { _ => Err(err_code), } } + + pub fn fp(&self) -> &vk::MvkIosSurfaceFn { + &self.ios_surface_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/mvk/macos_surface.rs b/ash/src/extensions/mvk/macos_surface.rs old mode 100644 new mode 100755 index 2dae98d..470fb08 --- a/ash/src/extensions/mvk/macos_surface.rs +++ b/ash/src/extensions/mvk/macos_surface.rs @@ -45,4 +45,12 @@ impl MacOSSurface { _ => Err(err_code), } } + + pub fn fp(&self) -> &vk::MvkMacosSurfaceFn { + &self.macos_surface_fn + } + + pub fn instance(&self) -> vk::Instance { + self.handle + } } diff --git a/ash/src/extensions/nv/mesh_shader.rs b/ash/src/extensions/nv/mesh_shader.rs old mode 100644 new mode 100755 index 20e3fea..82478a5 --- a/ash/src/extensions/nv/mesh_shader.rs +++ b/ash/src/extensions/nv/mesh_shader.rs @@ -67,4 +67,8 @@ impl MeshShader { pub fn name() -> &'static CStr { vk::NvMeshShaderFn::name() } + + pub fn fp(&self) -> &vk::NvMeshShaderFn { + &self.mesh_shader_fn + } } diff --git a/ash/src/extensions/nv/ray_tracing.rs b/ash/src/extensions/nv/ray_tracing.rs old mode 100644 new mode 100755 index c4baec7..228e8f8 --- a/ash/src/extensions/nv/ray_tracing.rs +++ b/ash/src/extensions/nv/ray_tracing.rs @@ -271,4 +271,12 @@ impl RayTracing { pub fn name() -> &'static CStr { vk::NvRayTracingFn::name() } + + pub fn fp(&self) -> &vk::NvRayTracingFn { + &self.ray_tracing_fn + } + + pub fn device(&self) -> vk::Device { + self.handle + } }