Beauty cleanup

This commit is contained in:
maik klein 2016-12-09 01:58:24 +01:00
parent f10e00eea2
commit 488d2392ce
2 changed files with 17 additions and 1 deletions

View file

@ -100,6 +100,7 @@ impl<'r> Device<'r> {
self.device_fn.destroy_semaphore(self.handle, semaphore, ptr::null());
}
}
pub fn device_wait_idle(&self) -> VkResult<()> {
unsafe {
let err_code = self.device_fn.device_wait_idle(self.handle);
@ -123,6 +124,7 @@ impl<'r> Device<'r> {
}
}
}
pub fn reset_fences(&self, fences: &[vk::Fence]) -> VkResult<()> {
unsafe {
let err_code = self.device_fn
@ -180,6 +182,7 @@ impl<'r> Device<'r> {
self.device_fn.cmd_end_render_pass(command_buffer);
}
}
pub fn cmd_draw(&self,
command_buffer: vk::CommandBuffer,
vertex_count: vk::uint32_t,
@ -203,6 +206,7 @@ impl<'r> Device<'r> {
viewports.as_ptr());
}
}
pub fn acquire_next_image_khr(&self,
swapchain: vk::SwapchainKHR,
timeout: vk::uint64_t,
@ -224,6 +228,7 @@ impl<'r> Device<'r> {
}
}
}
pub fn create_semaphore(&self,
create_info: &vk::SemaphoreCreateInfo)
-> VkResult<vk::Semaphore> {
@ -258,6 +263,7 @@ impl<'r> Device<'r> {
}
}
}
pub fn create_buffer(&self, create_info: &vk::BufferCreateInfo) -> VkResult<vk::Buffer> {
unsafe {
let mut buffer = mem::uninitialized();
@ -443,6 +449,7 @@ impl<'r> Device<'r> {
}
}
}
pub fn queue_submit(&self,
queue: vk::Queue,
submits: &[vk::SubmitInfo],
@ -474,6 +481,7 @@ impl<'r> Device<'r> {
}
}
}
pub fn get_swapchain_images_khr(&self,
swapchain: vk::SwapchainKHR)
-> VkResult<Vec<vk::Image>> {
@ -507,6 +515,7 @@ impl<'r> Device<'r> {
}
}
}
pub fn create_command_pool(&self,
create_info: &vk::CommandPoolCreateInfo)
-> VkResult<vk::CommandPool> {
@ -520,6 +529,7 @@ impl<'r> Device<'r> {
}
}
}
pub fn create_swapchain_khr(&self,
create_info: &vk::SwapchainCreateInfoKHR)
-> VkResult<vk::SwapchainKHR> {

View file

@ -24,11 +24,13 @@ impl<'r> Instance<'r> {
_lifetime: ::std::marker::PhantomData,
}
}
pub fn destroy_instance(&self) {
unsafe {
self.instance_fn.destroy_instance(self.handle, ptr::null());
}
}
pub fn destroy_debug_report_callback_ext(&self, debug: vk::DebugReportCallbackEXT) {
unsafe {
self.instance_fn.destroy_debug_report_callback_ext(self.handle, debug, ptr::null());
@ -51,6 +53,7 @@ impl<'r> Instance<'r> {
}
}
}
pub fn get_physical_device_memory_properties(&self,
physical_device: vk::PhysicalDevice)
-> vk::PhysicalDeviceMemoryProperties {
@ -85,6 +88,7 @@ impl<'r> Instance<'r> {
}
}
}
pub fn get_physical_device_surface_capabilities_khr(&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR)
@ -131,6 +135,7 @@ impl<'r> Instance<'r> {
self.instance_fn.destroy_surface_khr(self.handle, surface, ptr::null());
}
}
pub fn create_xlib_surface_khr(&self,
create_info: &vk::XlibSurfaceCreateInfoKHR)
-> VkResult<vk::SurfaceKHR> {
@ -145,6 +150,7 @@ impl<'r> Instance<'r> {
}
}
pub fn get_physical_device_surface_support_khr(&self,
physical_device: vk::PhysicalDevice,
queue_index: vk::uint32_t,
@ -159,8 +165,8 @@ impl<'r> Instance<'r> {
&mut b);
b > 0
}
}
pub fn get_physical_device_queue_family_properties(&self,
physical_device: vk::PhysicalDevice)
-> Vec<vk::QueueFamilyProperties> {