Remove incorrect device params (#284)

* Remove incorrect device params

* Fmt
This commit is contained in:
Maik Klein 2020-04-11 12:18:31 +02:00 committed by GitHub
parent a480c57152
commit e575b233e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 28 deletions

View file

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] - ReleaseDate ## [Unreleased] - ReleaseDate
### Changed
- The `vk::Device` parameter in 1.2 functions is now implicit.
## [0.30.0] - 2020-03-22 ## [0.30.0] - 2020-03-22
### Added ### Added

View file

@ -111,25 +111,20 @@ pub trait DeviceV1_2: DeviceV1_1 {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkResetQueryPool.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkResetQueryPool.html>"]
unsafe fn reset_query_pool( unsafe fn reset_query_pool(
&self, &self,
device: vk::Device,
query_pool: vk::QueryPool, query_pool: vk::QueryPool,
first_query: u32, first_query: u32,
query_count: u32, query_count: u32,
) { ) {
self.fp_v1_2() self.fp_v1_2()
.reset_query_pool(device, query_pool, first_query, query_count); .reset_query_pool(self.handle(), query_pool, first_query, query_count);
} }
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSemaphoreCounterValue.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetSemaphoreCounterValue.html>"]
unsafe fn get_semaphore_counter_value( unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> {
&self,
device: vk::Device,
semaphore: vk::Semaphore,
) -> VkResult<u64> {
let mut value = 0; let mut value = 0;
let err_code = self let err_code =
.fp_v1_2() self.fp_v1_2()
.get_semaphore_counter_value(device, semaphore, &mut value); .get_semaphore_counter_value(self.handle(), semaphore, &mut value);
match err_code { match err_code {
vk::Result::SUCCESS => Ok(value), vk::Result::SUCCESS => Ok(value),
_ => Err(err_code), _ => Err(err_code),
@ -139,11 +134,12 @@ pub trait DeviceV1_2: DeviceV1_1 {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWaitSemaphores.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkWaitSemaphores.html>"]
unsafe fn wait_semaphores( unsafe fn wait_semaphores(
&self, &self,
device: vk::Device,
wait_info: &vk::SemaphoreWaitInfo, wait_info: &vk::SemaphoreWaitInfo,
timeout: u64, timeout: u64,
) -> VkResult<()> { ) -> VkResult<()> {
let err_code = self.fp_v1_2().wait_semaphores(device, wait_info, timeout); let err_code = self
.fp_v1_2()
.wait_semaphores(self.handle(), wait_info, timeout);
match err_code { match err_code {
vk::Result::SUCCESS => Ok(()), vk::Result::SUCCESS => Ok(()),
_ => Err(err_code), _ => Err(err_code),
@ -151,12 +147,8 @@ pub trait DeviceV1_2: DeviceV1_1 {
} }
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSignalSemaphore.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkSignalSemaphore.html>"]
unsafe fn signal_semaphore( unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
&self, let err_code = self.fp_v1_2().signal_semaphore(self.handle(), signal_info);
device: vk::Device,
signal_info: &vk::SemaphoreSignalInfo,
) -> VkResult<()> {
let err_code = self.fp_v1_2().signal_semaphore(device, signal_info);
match err_code { match err_code {
vk::Result::SUCCESS => Ok(()), vk::Result::SUCCESS => Ok(()),
_ => Err(err_code), _ => Err(err_code),
@ -166,30 +158,25 @@ pub trait DeviceV1_2: DeviceV1_1 {
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddress.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferDeviceAddress.html>"]
unsafe fn get_buffer_device_address( unsafe fn get_buffer_device_address(
&self, &self,
device: vk::Device,
info: &vk::BufferDeviceAddressInfo, info: &vk::BufferDeviceAddressInfo,
) -> vk::DeviceAddress { ) -> vk::DeviceAddress {
self.fp_v1_2().get_buffer_device_address(device, info) self.fp_v1_2()
.get_buffer_device_address(self.handle(), info)
} }
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferOpaqueCaptureAddress.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetBufferOpaqueCaptureAddress.html>"]
unsafe fn get_buffer_opaque_capture_address( unsafe fn get_buffer_opaque_capture_address(&self, info: &vk::BufferDeviceAddressInfo) -> u64 {
&self,
device: vk::Device,
info: &vk::BufferDeviceAddressInfo,
) -> u64 {
self.fp_v1_2() self.fp_v1_2()
.get_buffer_opaque_capture_address(device, info) .get_buffer_opaque_capture_address(self.handle(), info)
} }
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddress.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddress.html>"]
unsafe fn get_device_memory_opaque_capture_address( unsafe fn get_device_memory_opaque_capture_address(
&self, &self,
device: vk::Device,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfo, info: &vk::DeviceMemoryOpaqueCaptureAddressInfo,
) -> u64 { ) -> u64 {
self.fp_v1_2() self.fp_v1_2()
.get_device_memory_opaque_capture_address(device, info) .get_device_memory_opaque_capture_address(self.handle(), info)
} }
} }
@ -2147,6 +2134,7 @@ pub struct Device {
device_fn_1_1: vk::DeviceFnV1_1, device_fn_1_1: vk::DeviceFnV1_1,
device_fn_1_2: vk::DeviceFnV1_2, device_fn_1_2: vk::DeviceFnV1_2,
} }
impl Device { impl Device {
pub unsafe fn load(instance_fn: &vk::InstanceFnV1_0, device: vk::Device) -> Self { pub unsafe fn load(instance_fn: &vk::InstanceFnV1_0, device: vk::Device) -> Self {
let device_fn_1_0 = vk::DeviceFnV1_0::load(|name| { let device_fn_1_0 = vk::DeviceFnV1_0::load(|name| {