Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose some underlying types in Vulkan hal #2667

Merged
merged 1 commit into from
May 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wgpu-hal/src/vulkan/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,10 @@ impl super::Instance {
}

impl super::Adapter {
pub fn raw_physical_device(&self) -> ash::vk::PhysicalDevice {
self.raw
}

pub fn required_device_extensions(&self, features: wgt::Features) -> Vec<&'static CStr> {
let (supported_extensions, unsupported_extensions) = self
.phd_capabilities
Expand Down
17 changes: 17 additions & 0 deletions wgpu-hal/src/vulkan/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,22 @@ impl super::Swapchain {
}

impl super::Instance {
pub fn entry(&self) -> &ash::Entry {
&self.shared.entry
}

pub fn raw_instance(&self) -> &ash::Instance {
&self.shared.raw
}

pub fn driver_api_version(&self) -> u32 {
self.shared.driver_api_version
}

pub fn extensions(&self) -> &[&'static CStr] {
&self.extensions[..]
}

pub fn required_extensions(
entry: &ash::Entry,
flags: crate::InstanceFlags,
Expand Down Expand Up @@ -266,6 +282,7 @@ impl super::Instance {
get_physical_device_properties,
entry,
has_nv_optimus,
driver_api_version,
}),
extensions,
})
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ struct InstanceShared {
get_physical_device_properties: Option<khr::GetPhysicalDeviceProperties2>,
entry: ash::Entry,
has_nv_optimus: bool,
driver_api_version: u32,
}

pub struct Instance {
Expand Down