Skip to content

Commit

Permalink
Split extension modules into vendor/extension hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Mar 17, 2024
1 parent f06c0c7 commit 03ad1f4
Show file tree
Hide file tree
Showing 86 changed files with 19,434 additions and 19,154 deletions.
10 changes: 4 additions & 6 deletions ash-examples/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ use std::ops::Drop;
use std::os::raw::c_char;

#[cfg(any(target_os = "macos", target_os = "ios"))]
use ash::vk::{
khr_get_physical_device_properties2, khr_portability_enumeration, khr_portability_subset,
};
use ash::vk::khr;

use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
Expand Down Expand Up @@ -238,9 +236,9 @@ impl ExampleBase {

#[cfg(any(target_os = "macos", target_os = "ios"))]
{
extension_names.push(khr_portability_enumeration::NAME.as_ptr());
extension_names.push(khr::portability_enumeration::NAME.as_ptr());
// Enabling this extension is a requirement when using `VK_KHR_portability_subset`
extension_names.push(khr_get_physical_device_properties2::NAME.as_ptr());
extension_names.push(khr::get_physical_device_properties2::NAME.as_ptr());
}

let appinfo = vk::ApplicationInfo::default()
Expand Down Expand Up @@ -324,7 +322,7 @@ impl ExampleBase {
let device_extension_names_raw = [
swapchain::NAME.as_ptr(),
#[cfg(any(target_os = "macos", target_os = "ios"))]
khr_portability_subset::NAME.as_ptr(),
khr::portability_subset::NAME.as_ptr(),
];
let features = vk::PhysicalDeviceFeatures {
shader_clip_distance: 1,
Expand Down
8 changes: 4 additions & 4 deletions ash/src/extensions/amd/buffer_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ use crate::vk;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::amd_buffer_marker::NAME;
pub const NAME: &CStr = vk::amd::buffer_marker::NAME;

#[derive(Clone)]
pub struct Device {
fp: vk::amd_buffer_marker::DeviceFn,
fp: vk::amd::buffer_marker::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let fp = vk::amd_buffer_marker::DeviceFn::load(|name| unsafe {
let fp = vk::amd::buffer_marker::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
});
Self { fp }
Expand All @@ -39,7 +39,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::amd_buffer_marker::DeviceFn {
pub fn fp(&self) -> &vk::amd::buffer_marker::DeviceFn {
&self.fp
}
}
8 changes: 4 additions & 4 deletions ash/src/extensions/amd/shader_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ use crate::vk;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::amd_shader_info::NAME;
pub const NAME: &CStr = vk::amd::shader_info::NAME;

#[derive(Clone)]
pub struct Device {
handle: vk::Device,
fp: vk::amd_shader_info::DeviceFn,
fp: vk::amd::shader_info::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let handle = device.handle();
let fp = vk::amd_shader_info::DeviceFn::load(|name| unsafe {
let fp = vk::amd::shader_info::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -67,7 +67,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::amd_shader_info::DeviceFn {
pub fn fp(&self) -> &vk::amd::shader_info::DeviceFn {
&self.fp
}

Expand Down
8 changes: 4 additions & 4 deletions ash/src/extensions/amdx/shader_enqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ use crate::RawPtr;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::amdx_shader_enqueue::NAME;
pub const NAME: &CStr = vk::amdx::shader_enqueue::NAME;

#[derive(Clone)]
pub struct Device {
handle: vk::Device,
fp: vk::amdx_shader_enqueue::DeviceFn,
fp: vk::amdx::shader_enqueue::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let handle = device.handle();
let fp = vk::amdx_shader_enqueue::DeviceFn::load(|name| unsafe {
let fp = vk::amdx::shader_enqueue::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -119,7 +119,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::amdx_shader_enqueue::DeviceFn {
pub fn fp(&self) -> &vk::amdx::shader_enqueue::DeviceFn {
&self.fp
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ use crate::vk;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::android_external_memory_android_hardware_buffer::NAME;
pub const NAME: &CStr = vk::android::external_memory_android_hardware_buffer::NAME;

#[derive(Clone)]
pub struct Device {
handle: vk::Device,
fp: vk::android_external_memory_android_hardware_buffer::DeviceFn,
fp: vk::android::external_memory_android_hardware_buffer::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let handle = device.handle();
let fp =
vk::android_external_memory_android_hardware_buffer::DeviceFn::load(|name| unsafe {
vk::android::external_memory_android_hardware_buffer::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -46,7 +46,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::android_external_memory_android_hardware_buffer::DeviceFn {
pub fn fp(&self) -> &vk::android::external_memory_android_hardware_buffer::DeviceFn {
&self.fp
}

Expand Down
8 changes: 4 additions & 4 deletions ash/src/extensions/ext/acquire_drm_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ use crate::vk;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_acquire_drm_display::NAME;
pub const NAME: &CStr = vk::ext::acquire_drm_display::NAME;

#[derive(Clone)]
pub struct Instance {
fp: vk::ext_acquire_drm_display::InstanceFn,
fp: vk::ext::acquire_drm_display::InstanceFn,
}

impl Instance {
pub fn new(entry: &crate::Entry, instance: &crate::Instance) -> Self {
let handle = instance.handle();
let fp = vk::ext_acquire_drm_display::InstanceFn::load(|name| unsafe {
let fp = vk::ext::acquire_drm_display::InstanceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { fp }
Expand Down Expand Up @@ -46,7 +46,7 @@ impl Instance {
}

#[inline]
pub fn fp(&self) -> &vk::ext_acquire_drm_display::InstanceFn {
pub fn fp(&self) -> &vk::ext::acquire_drm_display::InstanceFn {
&self.fp
}
}
8 changes: 4 additions & 4 deletions ash/src/extensions/ext/buffer_device_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ use crate::vk;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_buffer_device_address::NAME;
pub const NAME: &CStr = vk::ext::buffer_device_address::NAME;

#[derive(Clone)]
pub struct Device {
handle: vk::Device,
fp: vk::ext_buffer_device_address::DeviceFn,
fp: vk::ext::buffer_device_address::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let handle = device.handle();
let fp = vk::ext_buffer_device_address::DeviceFn::load(|name| unsafe {
let fp = vk::ext::buffer_device_address::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand All @@ -31,7 +31,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::ext_buffer_device_address::DeviceFn {
pub fn fp(&self) -> &vk::ext::buffer_device_address::DeviceFn {
&self.fp
}

Expand Down
14 changes: 7 additions & 7 deletions ash/src/extensions/ext/calibrated_timestamps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ use crate::vk;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_calibrated_timestamps::NAME;
pub const NAME: &CStr = vk::ext::calibrated_timestamps::NAME;

/// High-level device function wrapper
#[derive(Clone)]
pub struct Device {
handle: vk::Device,
fp: vk::ext_calibrated_timestamps::DeviceFn,
fp: vk::ext::calibrated_timestamps::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let handle = device.handle();
let fp = vk::ext_calibrated_timestamps::DeviceFn::load(|name| unsafe {
let fp = vk::ext::calibrated_timestamps::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -46,7 +46,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::ext_calibrated_timestamps::DeviceFn {
pub fn fp(&self) -> &vk::ext::calibrated_timestamps::DeviceFn {
&self.fp
}

Expand All @@ -59,13 +59,13 @@ impl Device {
/// High-level instance function wrapper
#[derive(Clone)]
pub struct Instance {
fp: vk::ext_calibrated_timestamps::InstanceFn,
fp: vk::ext::calibrated_timestamps::InstanceFn,
}

impl Instance {
pub fn new(entry: &crate::Entry, instance: &crate::Instance) -> Self {
let handle = instance.handle();
let fp = vk::ext_calibrated_timestamps::InstanceFn::load(|name| unsafe {
let fp = vk::ext::calibrated_timestamps::InstanceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { fp }
Expand All @@ -87,7 +87,7 @@ impl Instance {
}

#[inline]
pub fn fp(&self) -> &vk::ext_calibrated_timestamps::InstanceFn {
pub fn fp(&self) -> &vk::ext::calibrated_timestamps::InstanceFn {
&self.fp
}
}
8 changes: 4 additions & 4 deletions ash/src/extensions/ext/debug_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ use crate::vk;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_debug_marker::NAME;
pub const NAME: &CStr = vk::ext::debug_marker::NAME;

#[derive(Clone)]
pub struct Device {
handle: vk::Device,
fp: vk::ext_debug_marker::DeviceFn,
fp: vk::ext::debug_marker::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let handle = device.handle();
let fp = vk::ext_debug_marker::DeviceFn::load(|name| unsafe {
let fp = vk::ext::debug_marker::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -58,7 +58,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::ext_debug_marker::DeviceFn {
pub fn fp(&self) -> &vk::ext::debug_marker::DeviceFn {
&self.fp
}

Expand Down
8 changes: 4 additions & 4 deletions ash/src/extensions/ext/debug_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ use crate::RawPtr;
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_debug_report::NAME;
pub const NAME: &CStr = vk::ext::debug_report::NAME;

#[derive(Clone)]
pub struct Instance {
handle: vk::Instance,
fp: vk::ext_debug_report::InstanceFn,
fp: vk::ext::debug_report::InstanceFn,
}

impl Instance {
pub fn new(entry: &crate::Entry, instance: &crate::Instance) -> Self {
let handle = instance.handle();
let fp = vk::ext_debug_report::InstanceFn::load(|name| unsafe {
let fp = vk::ext::debug_report::InstanceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -55,7 +55,7 @@ impl Instance {
}

#[inline]
pub fn fp(&self) -> &vk::ext_debug_report::InstanceFn {
pub fn fp(&self) -> &vk::ext::debug_report::InstanceFn {
&self.fp
}

Expand Down
14 changes: 7 additions & 7 deletions ash/src/extensions/ext/debug_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ use crate::{vk, RawPtr};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_debug_utils::NAME;
pub const NAME: &CStr = vk::ext::debug_utils::NAME;

/// High-level device function wrapper
#[derive(Clone)]
pub struct Device {
handle: vk::Device,
fp: vk::ext_debug_utils::DeviceFn,
fp: vk::ext::debug_utils::DeviceFn,
}

impl Device {
pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self {
let handle = device.handle();
let fp = vk::ext_debug_utils::DeviceFn::load(|name| unsafe {
let fp = vk::ext::debug_utils::DeviceFn::load(|name| unsafe {
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -94,7 +94,7 @@ impl Device {
}

#[inline]
pub fn fp(&self) -> &vk::ext_debug_utils::DeviceFn {
pub fn fp(&self) -> &vk::ext::debug_utils::DeviceFn {
&self.fp
}

Expand All @@ -108,13 +108,13 @@ impl Device {
#[derive(Clone)]
pub struct Instance {
handle: vk::Instance,
fp: vk::ext_debug_utils::InstanceFn,
fp: vk::ext::debug_utils::InstanceFn,
}

impl Instance {
pub fn new(entry: &crate::Entry, instance: &crate::Instance) -> Self {
let handle = instance.handle();
let fp = vk::ext_debug_utils::InstanceFn::load(|name| unsafe {
let fp = vk::ext::debug_utils::InstanceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -164,7 +164,7 @@ impl Instance {
}

#[inline]
pub fn fp(&self) -> &vk::ext_debug_utils::InstanceFn {
pub fn fp(&self) -> &vk::ext::debug_utils::InstanceFn {
&self.fp
}

Expand Down
Loading

0 comments on commit 03ad1f4

Please sign in to comment.