Update to 2018 edition

This commit is contained in:
Aaron Loucks 2019-05-25 15:25:00 -04:00
parent 19771a8200
commit 284043b605
27 changed files with 81 additions and 79 deletions

View file

@ -8,6 +8,7 @@ repository = "https://github.com/MaikKlein/ash"
readme = "../README.md" readme = "../README.md"
keywords = ["vulkan", "graphic"] keywords = ["vulkan", "graphic"]
documentation = "https://docs.rs/ash" documentation = "https://docs.rs/ash"
edition = "2018"
[dependencies] [dependencies]
shared_library = "0.1.9" shared_library = "0.1.9"

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::mem; use std::mem;
use std::os::raw::c_void; use std::os::raw::c_void;
use std::ptr; use std::ptr;
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
pub trait DeviceV1_1: DeviceV1_0 { pub trait DeviceV1_1: DeviceV1_0 {

View file

@ -1,5 +1,5 @@
use instance::Instance; use crate::instance::Instance;
use prelude::*; use crate::prelude::*;
use shared_library::dynamic_library::DynamicLibrary; use shared_library::dynamic_library::DynamicLibrary;
use std::error::Error; use std::error::Error;
use std::fmt; use std::fmt;
@ -9,8 +9,8 @@ use std::os::raw::c_void;
use std::path::Path; use std::path::Path;
use std::ptr; use std::ptr;
use std::sync::Arc; use std::sync::Arc;
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[cfg(windows)] #[cfg(windows)]
const LIB_PATH: &'static str = "vulkan-1.dll"; const LIB_PATH: &'static str = "vulkan-1.dll";

View file

@ -25,7 +25,7 @@
use std::fmt; use std::fmt;
use std::os::raw::*; use std::os::raw::*;
use vk::*; use crate::vk::*;
// Extension: `VK_AMD_gpa_interface` // Extension: `VK_AMD_gpa_interface`

View file

@ -1,9 +1,9 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{DeviceV1_0, InstanceV1_0}; use crate::version::{DeviceV1_0, InstanceV1_0};
use vk; use crate::vk;
#[derive(Clone)] #[derive(Clone)]
pub struct DebugMarker { pub struct DebugMarker {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct DebugReport { pub struct DebugReport {

View file

@ -1,9 +1,9 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use {vk, RawPtr}; use crate::{vk, RawPtr};
#[derive(Clone)] #[derive(Clone)]
pub struct DebugUtils { pub struct DebugUtils {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct AndroidSurface { pub struct AndroidSurface {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{DeviceV1_0, InstanceV1_0}; use crate::version::{DeviceV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct DisplaySwapchain { pub struct DisplaySwapchain {

View file

@ -1,11 +1,11 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct Surface { pub struct Surface {

View file

@ -1,11 +1,11 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use version::{DeviceV1_0, InstanceV1_0}; use crate::version::{DeviceV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct Swapchain { pub struct Swapchain {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct WaylandSurface { pub struct WaylandSurface {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct Win32Surface { pub struct Win32Surface {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct XcbSurface { pub struct XcbSurface {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct XlibSurface { pub struct XlibSurface {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct IOSSurface { pub struct IOSSurface {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{EntryV1_0, InstanceV1_0}; use crate::version::{EntryV1_0, InstanceV1_0};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct MacOSSurface { pub struct MacOSSurface {

View file

@ -1,8 +1,8 @@
#![allow(dead_code)] #![allow(dead_code)]
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{DeviceV1_0, InstanceV1_0}; use crate::version::{DeviceV1_0, InstanceV1_0};
use vk; use crate::vk;
#[derive(Clone)] #[derive(Clone)]
pub struct MeshShader { pub struct MeshShader {

View file

@ -1,10 +1,10 @@
#![allow(dead_code)] #![allow(dead_code)]
use prelude::*; use crate::prelude::*;
use std::ffi::CStr; use std::ffi::CStr;
use std::mem; use std::mem;
use version::{DeviceV1_0, InstanceV1_0, InstanceV1_1}; use crate::version::{DeviceV1_0, InstanceV1_0, InstanceV1_1};
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[derive(Clone)] #[derive(Clone)]
pub struct RayTracing { pub struct RayTracing {

View file

@ -1,11 +1,11 @@
#![allow(dead_code)] #![allow(dead_code)]
use device::Device; use crate::device::Device;
use prelude::*; use crate::prelude::*;
use std::mem; use std::mem;
use std::os::raw::c_char; use std::os::raw::c_char;
use std::ptr; use std::ptr;
use vk; use crate::vk;
use RawPtr; use crate::RawPtr;
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkInstance.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkInstance.html>"]
#[derive(Clone)] #[derive(Clone)]

View file

@ -25,9 +25,9 @@
extern crate shared_library; extern crate shared_library;
pub use device::Device; pub use crate::device::Device;
pub use entry::{Entry, EntryCustom, InstanceError, LoadingError}; pub use crate::entry::{Entry, EntryCustom, InstanceError, LoadingError};
pub use instance::Instance; pub use crate::instance::Instance;
mod device; mod device;
mod entry; mod entry;

View file

@ -1,2 +1,2 @@
use vk; use crate::vk;
pub type VkResult<T> = Result<T, vk::Result>; pub type VkResult<T> = Result<T, vk::Result>;

View file

@ -3,7 +3,7 @@ use std::marker::PhantomData;
use std::mem::size_of; use std::mem::size_of;
use std::os::raw::c_void; use std::os::raw::c_void;
use std::{io, slice}; use std::{io, slice};
use vk; use crate::vk;
/// `Align` handles dynamic alignment. The is useful for dynamic uniform buffers where /// `Align` handles dynamic alignment. The is useful for dynamic uniform buffers where
/// the alignment might be different. For example a 4x4 f32 matrix has a size of 64 bytes /// the alignment might be different. For example a 4x4 f32 matrix has a size of 64 bytes

View file

@ -1,3 +1,3 @@
pub use device::{DeviceV1_0, DeviceV1_1}; pub use crate::device::{DeviceV1_0, DeviceV1_1};
pub use entry::{EntryV1_0, EntryV1_1}; pub use crate::entry::{EntryV1_0, EntryV1_1};
pub use instance::{InstanceV1_0, InstanceV1_1}; pub use crate::instance::{InstanceV1_0, InstanceV1_1};

View file

@ -18,7 +18,7 @@ pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut
pub trait Handle { pub trait Handle {
const TYPE: ObjectType; const TYPE: ObjectType;
fn as_raw(self) -> u64; fn as_raw(self) -> u64;
fn from_raw(u64) -> Self; fn from_raw(_: u64) -> Self;
} }
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VK_MAKE_VERSION.html>"] #[doc = "<https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VK_MAKE_VERSION.html>"]
#[macro_export] #[macro_export]

View file

@ -2,6 +2,7 @@
name = "generator" name = "generator"
version = "0.1.0" version = "0.1.0"
authors = ["Maik Klein <maikklein@googlemail.com>"] authors = ["Maik Klein <maikklein@googlemail.com>"]
edition = "2018"
[dependencies] [dependencies]
vk-parse = "0.2" vk-parse = "0.2"

View file

@ -1432,7 +1432,7 @@ pub fn derive_setters(
_ => None, _ => None,
}); });
let (has_next, is_next_const) = match members let (has_next, _is_next_const) = match members
.clone() .clone()
.find(|field| field.param_ident().to_string() == "p_next") .find(|field| field.param_ident().to_string() == "p_next")
{ {
@ -2275,7 +2275,7 @@ pub fn write_source_code(path: &Path) {
pub trait Handle { pub trait Handle {
const TYPE: ObjectType; const TYPE: ObjectType;
fn as_raw(self) -> u64; fn as_raw(self) -> u64;
fn from_raw(u64) -> Self; fn from_raw(_: u64) -> Self;
} }
#version_macros #version_macros