Address validation error

This commit is contained in:
Maik Klein 2018-12-09 22:13:08 +01:00
parent 25df12f1ce
commit 0b68c25801
2 changed files with 3 additions and 2 deletions

View file

@ -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,
};

View file

@ -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<E: EntryV1_0, I: InstanceV1_0>(
instance: &I,
window: &winit::Window,
) -> Result<vk::SurfaceKHR, vk::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<E: EntryV1_0, I: InstanceV1_0>(
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;