Remove unused versioning

This commit is contained in:
Maik Klein 2018-11-11 10:46:03 +01:00
parent b5fc6d37f2
commit 373ed42402
6 changed files with 0 additions and 185 deletions

View file

@ -3,7 +3,6 @@ use prelude::*;
use std::mem;
use std::os::raw::c_void;
use std::ptr;
use version::{FunctionPointers, V1_0, V1_1};
use vk;
use RawPtr;

View file

@ -7,7 +7,6 @@ use std::mem;
use std::os::raw::c_char;
use std::path::Path;
use std::ptr;
use version::{EntryLoader, FunctionPointers, InstanceLoader, V1_0, V1_1};
use vk;
use RawPtr;

View file

@ -4,8 +4,6 @@ use prelude::*;
use std::mem;
use std::os::raw::c_char;
use std::ptr;
use version::DeviceLoader;
use version::{FunctionPointers, V1_0, V1_1};
use vk;
use RawPtr;

View file

@ -1,182 +1,3 @@
pub use device::{DeviceV1_0, DeviceV1_1};
pub use entry::{EntryV1_0, EntryV1_1};
pub use instance::{InstanceV1_0, InstanceV1_1};
use std::mem;
use vk;
pub trait FunctionPointers {
type InstanceFp: InstanceLoader + Clone;
type DeviceFp: DeviceLoader + Clone;
type EntryFp: EntryLoader + Clone;
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct V1_1;
impl FunctionPointers for V1_1 {
type InstanceFp = InstanceFpV1_1;
type DeviceFp = DeviceFpV1_1;
type EntryFp = EntryFpV1_1;
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct V1_0;
impl FunctionPointers for V1_0 {
type InstanceFp = InstanceFpV1_0;
type DeviceFp = DeviceFpV1_0;
type EntryFp = EntryFpV1_0;
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct EntryFpV1_0 {
pub entry_fn: vk::EntryFnV1_0,
}
impl EntryLoader for EntryFpV1_0 {
fn fp_v1_0(&self) -> &vk::EntryFnV1_0 {
&self.entry_fn
}
unsafe fn load(static_fn: &vk::StaticFn) -> Self {
let entry_fn = vk::EntryFnV1_0::load(|name| {
mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr()))
});
EntryFpV1_0 { entry_fn: entry_fn }
}
}
pub trait EntryLoader: Sized {
fn fp_v1_0(&self) -> &vk::EntryFnV1_0;
unsafe fn load(static_fn: &vk::StaticFn) -> Self;
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct EntryFpV1_1 {
pub entry_fn_1_0: vk::EntryFnV1_0,
pub entry_fn_1_1: vk::EntryFnV1_1,
}
impl EntryLoader for EntryFpV1_1 {
fn fp_v1_0(&self) -> &vk::EntryFnV1_0 {
&self.entry_fn_1_0
}
unsafe fn load(static_fn: &vk::StaticFn) -> Self {
let entry_fn_1_0 = vk::EntryFnV1_0::load(|name| {
mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr()))
});
let entry_fn_1_1 = vk::EntryFnV1_1::load(|name| {
mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr()))
});
EntryFpV1_1 {
entry_fn_1_0,
entry_fn_1_1,
}
}
}
pub trait InstanceLoader: Sized {
unsafe fn load(
static_fn: &vk::StaticFn,
instance: vk::Instance,
) -> Self;
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct InstanceFpV1_0 {
pub instance_fn: vk::InstanceFnV1_0,
}
impl InstanceLoader for InstanceFpV1_0 {
unsafe fn load(
static_fn: &vk::StaticFn,
instance: vk::Instance,
) -> Self {
let instance_fn = vk::InstanceFnV1_0::load(|name| {
mem::transmute(static_fn.get_instance_proc_addr(instance, name.as_ptr()))
});
InstanceFpV1_0 {
instance_fn: instance_fn,
}
}
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct InstanceFpV1_1 {
pub instance_fn_1_0: vk::InstanceFnV1_0,
pub instance_fn_1_1: vk::InstanceFnV1_1,
}
impl InstanceLoader for InstanceFpV1_1 {
unsafe fn load(
static_fn: &vk::StaticFn,
instance: vk::Instance,
) -> Self {
let instance_fn_1_0 = vk::InstanceFnV1_0::load(|name| {
mem::transmute(static_fn.get_instance_proc_addr(instance, name.as_ptr()))
});
let instance_fn_1_1 = vk::InstanceFnV1_1::load(|name| {
mem::transmute(static_fn.get_instance_proc_addr(instance, name.as_ptr()))
});
InstanceFpV1_1 {
instance_fn_1_0,
instance_fn_1_1,
}
}
}
pub trait DeviceLoader: Sized {
unsafe fn load(
instance_fn: &vk::InstanceFnV1_0,
device: vk::Device,
) -> Self;
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct DeviceFpV1_0 {
pub device_fn: vk::DeviceFnV1_0,
}
impl DeviceLoader for DeviceFpV1_0 {
unsafe fn load(
instance_fn: &vk::InstanceFnV1_0,
device: vk::Device,
) -> Self {
let device_fn = vk::DeviceFnV1_0::load(|name| {
mem::transmute(instance_fn.get_device_proc_addr(device, name.as_ptr()))
});
DeviceFpV1_0 {
device_fn: device_fn,
}
}
}
#[allow(non_camel_case_types)]
#[derive(Clone)]
pub struct DeviceFpV1_1 {
pub device_fn_1_0: vk::DeviceFnV1_0,
pub device_fn_1_1: vk::DeviceFnV1_1,
}
impl DeviceLoader for DeviceFpV1_1 {
unsafe fn load(
instance_fn: &vk::InstanceFnV1_0,
device: vk::Device,
) -> Self {
let device_fn_1_0 = vk::DeviceFnV1_0::load(|name| {
mem::transmute(instance_fn.get_device_proc_addr(device, name.as_ptr()))
});
let device_fn_1_1 = vk::DeviceFnV1_1::load(|name| {
mem::transmute(instance_fn.get_device_proc_addr(device, name.as_ptr()))
});
DeviceFpV1_1 {
device_fn_1_0,
device_fn_1_1,
}
}
}

View file

@ -1,5 +1,4 @@
extern crate ash;
#[macro_use]
extern crate examples;
extern crate image;

View file

@ -1,5 +1,4 @@
extern crate ash;
#[macro_use]
extern crate examples;
use ash::util::*;