From 9a6afac6ea12b32e1964d4aaa01a61bf4986e65d Mon Sep 17 00:00:00 2001 From: unknownue Date: Mon, 20 May 2019 21:28:38 +0800 Subject: [PATCH] Fix black screen for examples on macOS platform --- examples/src/bin/texture.rs | 8 ++++---- examples/src/bin/triangle.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/src/bin/texture.rs b/examples/src/bin/texture.rs index 3e12002..42664a5 100644 --- a/examples/src/bin/texture.rs +++ b/examples/src/bin/texture.rs @@ -112,7 +112,7 @@ fn main() { let index_buffer_memory_index = find_memorytype_index( &index_buffer_memory_req, &base.device_memory_properties, - vk::MemoryPropertyFlags::HOST_VISIBLE, + vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT, ) .expect("Unable to find suitable memorytype for the index buffer."); let index_allocate_info = vk::MemoryAllocateInfo { @@ -178,7 +178,7 @@ fn main() { let vertex_input_buffer_memory_index = find_memorytype_index( &vertex_input_buffer_memory_req, &base.device_memory_properties, - vk::MemoryPropertyFlags::HOST_VISIBLE, + vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT, ) .expect("Unable to find suitable memorytype for the vertex buffer."); @@ -234,7 +234,7 @@ fn main() { let uniform_color_buffer_memory_index = find_memorytype_index( &uniform_color_buffer_memory_req, &base.device_memory_properties, - vk::MemoryPropertyFlags::HOST_VISIBLE, + vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT, ) .expect("Unable to find suitable memorytype for the vertex buffer."); @@ -281,7 +281,7 @@ fn main() { let image_buffer_memory_index = find_memorytype_index( &image_buffer_memory_req, &base.device_memory_properties, - vk::MemoryPropertyFlags::HOST_VISIBLE, + vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT, ) .expect("Unable to find suitable memorytype for the vertex buffer."); diff --git a/examples/src/bin/triangle.rs b/examples/src/bin/triangle.rs index 267c315..0104344 100644 --- a/examples/src/bin/triangle.rs +++ b/examples/src/bin/triangle.rs @@ -100,7 +100,7 @@ fn main() { let index_buffer_memory_index = find_memorytype_index( &index_buffer_memory_req, &base.device_memory_properties, - vk::MemoryPropertyFlags::HOST_VISIBLE, + vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT, ) .expect("Unable to find suitable memorytype for the index buffer."); @@ -152,7 +152,7 @@ fn main() { let vertex_input_buffer_memory_index = find_memorytype_index( &vertex_input_buffer_memory_req, &base.device_memory_properties, - vk::MemoryPropertyFlags::HOST_VISIBLE, + vk::MemoryPropertyFlags::HOST_VISIBLE | vk::MemoryPropertyFlags::HOST_COHERENT, ) .expect("Unable to find suitable memorytype for the vertex buffer.");