diff --git a/ash/src/extensions/khr/pipeline_executable_properties.rs b/ash/src/extensions/khr/pipeline_executable_properties.rs index 3662f6f..5dbd060 100644 --- a/ash/src/extensions/khr/pipeline_executable_properties.rs +++ b/ash/src/extensions/khr/pipeline_executable_properties.rs @@ -1,23 +1,23 @@ use crate::prelude::*; use crate::vk; -use crate::{Entry, Instance}; +use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; #[derive(Clone)] pub struct PipelineExecutableProperties { - handle: vk::Instance, + handle: vk::Device, pipeline_executable_properties_fn: vk::KhrPipelineExecutablePropertiesFn, } impl PipelineExecutableProperties { - pub fn new(entry: &Entry, instance: &Instance) -> Self { + pub fn new(instance: &Instance, device: &Device) -> Self { let pipeline_executable_properties_fn = vk::KhrPipelineExecutablePropertiesFn::load(|name| unsafe { - mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) + mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr())) }); Self { - handle: instance.handle(), + handle: device.handle(), pipeline_executable_properties_fn, } } @@ -29,13 +29,12 @@ impl PipelineExecutableProperties { #[doc = ""] pub unsafe fn get_pipeline_executable_internal_representations( &self, - device: vk::Device, executable_info: &vk::PipelineExecutableInfoKHR, ) -> VkResult> { read_into_defaulted_vector(|count, data| { self.pipeline_executable_properties_fn .get_pipeline_executable_internal_representations_khr( - device, + self.handle, executable_info, count, data, @@ -46,24 +45,24 @@ impl PipelineExecutableProperties { #[doc = ""] pub unsafe fn get_pipeline_executable_properties( &self, - device: vk::Device, + pipeline_info: &vk::PipelineInfoKHR, ) -> VkResult> { read_into_defaulted_vector(|count, data| { self.pipeline_executable_properties_fn - .get_pipeline_executable_properties_khr(device, pipeline_info, count, data) + .get_pipeline_executable_properties_khr(self.handle, pipeline_info, count, data) }) } #[doc = ""] pub unsafe fn get_pipeline_executable_statistics( &self, - device: vk::Device, + executable_info: &vk::PipelineExecutableInfoKHR, ) -> VkResult> { read_into_defaulted_vector(|count, data| { self.pipeline_executable_properties_fn - .get_pipeline_executable_statistics_khr(device, executable_info, count, data) + .get_pipeline_executable_statistics_khr(self.handle, executable_info, count, data) }) } @@ -71,7 +70,7 @@ impl PipelineExecutableProperties { &self.pipeline_executable_properties_fn } - pub fn instance(&self) -> vk::Instance { + pub fn device(&self) -> vk::Device { self.handle } } diff --git a/ash/src/extensions/khr/timeline_semaphore.rs b/ash/src/extensions/khr/timeline_semaphore.rs index 4de9c3f..2bb11b2 100644 --- a/ash/src/extensions/khr/timeline_semaphore.rs +++ b/ash/src/extensions/khr/timeline_semaphore.rs @@ -1,22 +1,22 @@ use crate::prelude::*; use crate::vk; -use crate::{Entry, Instance}; +use crate::{Device, Instance}; use std::ffi::CStr; use std::mem; #[derive(Clone)] pub struct TimelineSemaphore { - handle: vk::Instance, + handle: vk::Device, timeline_semaphore_fn: vk::KhrTimelineSemaphoreFn, } impl TimelineSemaphore { - pub fn new(entry: &Entry, instance: &Instance) -> Self { + pub fn new(instance: &Instance, device: &Device) -> Self { let timeline_semaphore_fn = vk::KhrTimelineSemaphoreFn::load(|name| unsafe { - mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) + mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr())) }); Self { - handle: instance.handle(), + handle: device.handle(), timeline_semaphore_fn, } } @@ -26,37 +26,28 @@ impl TimelineSemaphore { } #[doc = ""] - pub unsafe fn get_semaphore_counter_value( - &self, - device: vk::Device, - semaphore: vk::Semaphore, - ) -> VkResult { + pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult { let mut value = 0; self.timeline_semaphore_fn - .get_semaphore_counter_value_khr(device, semaphore, &mut value) + .get_semaphore_counter_value_khr(self.handle, semaphore, &mut value) .result_with_success(value) } #[doc = ""] pub unsafe fn wait_semaphores( &self, - device: vk::Device, wait_info: &vk::SemaphoreWaitInfo, timeout: u64, ) -> VkResult<()> { self.timeline_semaphore_fn - .wait_semaphores_khr(device, wait_info, timeout) + .wait_semaphores_khr(self.handle, wait_info, timeout) .result() } #[doc = ""] - pub unsafe fn signal_semaphore( - &self, - device: vk::Device, - signal_info: &vk::SemaphoreSignalInfo, - ) -> VkResult<()> { + pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> { self.timeline_semaphore_fn - .signal_semaphore_khr(device, signal_info) + .signal_semaphore_khr(self.handle, signal_info) .result() } @@ -64,7 +55,7 @@ impl TimelineSemaphore { &self.timeline_semaphore_fn } - pub fn instance(&self) -> vk::Instance { + pub fn device(&self) -> vk::Device { self.handle } }