From 0b68c25801bfb71e6cd089261f1ecc8d3b6c8b99 Mon Sep 17 00:00:00 2001 From: Maik Klein Date: Sun, 9 Dec 2018 22:13:08 +0100 Subject: [PATCH 1/2] Address validation error --- examples/src/bin/texture.rs | 2 +- examples/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/src/bin/texture.rs b/examples/src/bin/texture.rs index 62d6bea..3e12002 100644 --- a/examples/src/bin/texture.rs +++ b/examples/src/bin/texture.rs @@ -523,7 +523,7 @@ fn main() { }; let tex_descriptor = vk::DescriptorImageInfo { - image_layout: vk::ImageLayout::GENERAL, + image_layout: vk::ImageLayout::SHADER_READ_ONLY_OPTIMAL, image_view: tex_image_view, sampler: sampler, }; diff --git a/examples/src/lib.rs b/examples/src/lib.rs index f25f514..dec9168 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -40,7 +40,6 @@ use std::default::Default; use std::ffi::{CStr, CString}; use std::ops::Drop; use std::os::raw::{c_char, c_void}; -use std::ptr; // Simple offset_of macro akin to C++ offsetof #[macro_export] @@ -127,6 +126,7 @@ unsafe fn create_surface( instance: &I, window: &winit::Window, ) -> Result { + use std::ptr; use winit::os::macos::WindowExt; let wnd: cocoa_id = mem::transmute(window.get_nswindow()); @@ -163,6 +163,7 @@ unsafe fn create_surface( use winapi::shared::windef::HWND; use winapi::um::libloaderapi::GetModuleHandleW; use winit::os::windows::WindowExt; + use std::ptr; let hwnd = window.get_hwnd() as HWND; let hinstance = GetModuleHandleW(ptr::null()) as *const c_void; From 813e6a836e1eaf2a686cd6de1bca9d5b2cc3d723 Mon Sep 17 00:00:00 2001 From: Maik Klein Date: Sun, 9 Dec 2018 22:24:11 +0100 Subject: [PATCH 2/2] Reformat --- examples/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/src/lib.rs b/examples/src/lib.rs index dec9168..b2463b1 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -160,10 +160,10 @@ unsafe fn create_surface( instance: &I, window: &winit::Window, ) -> Result { + use std::ptr; use winapi::shared::windef::HWND; use winapi::um::libloaderapi::GetModuleHandleW; use winit::os::windows::WindowExt; - use std::ptr; let hwnd = window.get_hwnd() as HWND; let hinstance = GetModuleHandleW(ptr::null()) as *const c_void;