Cleanup additional warnings

This commit is contained in:
maik klein 2017-01-05 09:52:32 +01:00
parent 42c1f97ffc
commit 6bc682893c
3 changed files with 30 additions and 34 deletions

View file

@ -422,20 +422,18 @@ pub trait DeviceV1_0 {
}
unsafe fn create_pipeline_layout(&self,
create_info: &vk::PipelineLayoutCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>)
-> VkResult<vk::PipelineLayout> {
unsafe {
let mut pipeline_layout = mem::uninitialized();
let err_code = self.fp_v1_0()
.create_pipeline_layout(self.handle(),
create_info,
allocation_callbacks.as_raw_ptr(),
&mut pipeline_layout);
match err_code {
vk::Result::Success => Ok(pipeline_layout),
_ => Err(err_code),
}
create_info: &vk::PipelineLayoutCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>)
-> VkResult<vk::PipelineLayout> {
let mut pipeline_layout = mem::uninitialized();
let err_code = self.fp_v1_0()
.create_pipeline_layout(self.handle(),
create_info,
allocation_callbacks.as_raw_ptr(),
&mut pipeline_layout);
match err_code {
vk::Result::Success => Ok(pipeline_layout),
_ => Err(err_code),
}
}
@ -463,20 +461,18 @@ pub trait DeviceV1_0 {
}
unsafe fn create_framebuffer(&self,
create_info: &vk::FramebufferCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>)
-> VkResult<vk::Framebuffer> {
unsafe {
let mut framebuffer = mem::uninitialized();
let err_code = self.fp_v1_0()
.create_framebuffer(self.handle(),
create_info,
allocation_callbacks.as_raw_ptr(),
&mut framebuffer);
match err_code {
vk::Result::Success => Ok(framebuffer),
_ => Err(err_code),
}
create_info: &vk::FramebufferCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>)
-> VkResult<vk::Framebuffer> {
let mut framebuffer = mem::uninitialized();
let err_code = self.fp_v1_0()
.create_framebuffer(self.handle(),
create_info,
allocation_callbacks.as_raw_ptr(),
&mut framebuffer);
match err_code {
vk::Result::Success => Ok(framebuffer),
_ => Err(err_code),
}
}

View file

@ -1,11 +1,10 @@
#![allow(dead_code)]
use prelude::*;
use std::mem;
use instance::Instance;
use entry::Entry;
use vk;
use std::ffi::CStr;
use ::RawPtr;
use version::{V1_0, EntryV1_0};
use version::{EntryV1_0, InstanceV1_0};
#[derive(Clone)]
pub struct DebugReport {
@ -14,9 +13,9 @@ pub struct DebugReport {
}
impl DebugReport {
pub fn new(entry: &Entry<V1_0>,
instance: &Instance<V1_0>)
-> Result<DebugReport, Vec<&'static str>> {
pub fn new<E: EntryV1_0, I: InstanceV1_0>(entry: &E,
instance: &I)
-> Result<DebugReport, Vec<&'static str>> {
let debug_report_fn = vk::DebugReportFn::load(|name| {
unsafe {
mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr()))

View file

@ -1,3 +1,4 @@
#![allow(dead_code)]
use prelude::*;
use std::ptr;
use std::mem;