From a10935eaf701845abac26dc433b43aadf29e2565 Mon Sep 17 00:00:00 2001 From: Brian Merchant Date: Sun, 19 Aug 2018 00:18:30 -0700 Subject: [PATCH] bug fixes for VK_EXT_debug_utils wrapper --- ash/src/extensions/debug_report.rs | 2 +- ash/src/extensions/debug_utils.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ash/src/extensions/debug_report.rs b/ash/src/extensions/debug_report.rs index 35e00e5..fda418f 100644 --- a/ash/src/extensions/debug_report.rs +++ b/ash/src/extensions/debug_report.rs @@ -22,7 +22,7 @@ impl DebugReport { })?; Ok(DebugReport { handle: instance.handle(), - debug_report_fn: debug_report_fn, + debug_report_fn, }) } diff --git a/ash/src/extensions/debug_utils.rs b/ash/src/extensions/debug_utils.rs index dd8d2ea..836e0fb 100644 --- a/ash/src/extensions/debug_utils.rs +++ b/ash/src/extensions/debug_utils.rs @@ -2,24 +2,26 @@ use prelude::*; use std::ffi::CStr; use std::mem; -use version::{DeviceV1_0, InstanceV1_0}; +use version::{EntryV1_0, InstanceV1_0}; use {vk, RawPtr}; #[derive(Clone)] pub struct DebugUtils { + handle: vk::Instance, debug_utils_fn: vk::ExtDebugUtilsFn, } impl DebugUtils { - pub fn new( + pub fn new( + entry: &E, instance: &I, - device: &D, ) -> Result> { let debug_utils_fn = vk::ExtDebugUtilsFn::load(|name| unsafe { - mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr())) + mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) })?; Ok(DebugUtils { - debug_utils_fn: debug_utils_fn, + handle: instance.handle(), + debug_utils_fn, }) } @@ -98,13 +100,12 @@ impl DebugUtils { pub unsafe fn create_debug_utils_messenger_ext( &self, - instance: vk::Instance, create_info: &vk::DebugUtilsMessengerCreateInfoEXT, allocator: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut messenger = mem::uninitialized(); let err_code = self.debug_utils_fn.create_debug_utils_messenger_ext( - instance, + self.handle, create_info, allocator.as_raw_ptr(), &mut messenger, @@ -117,12 +118,11 @@ impl DebugUtils { pub unsafe fn destroy_debug_utils_messenger_ext( &self, - instance: vk::Instance, messenger: vk::DebugUtilsMessengerEXT, allocator: Option<&vk::AllocationCallbacks>, ) { self.debug_utils_fn.destroy_debug_utils_messenger_ext( - instance, + self.handle, messenger, allocator.as_raw_ptr(), );