212: Fix black screen for examples on macOS platform r=MaikKlein a=unknownue

The memory types may vary between different versions of MoltenVK.
This solution just changes all the memory request flags to both `HOST_VISIBLE` and `HOST_COHERENT` to fix the delay of memory data transfer.

Co-authored-by: unknownue <usami-ssc@protonmail.com>
This commit is contained in:
bors[bot] 2019-05-20 16:36:38 +00:00
commit 19771a8200
2 changed files with 6 additions and 6 deletions

View file

@ -112,7 +112,7 @@ fn main() {
let index_buffer_memory_index = find_memorytype_index( let index_buffer_memory_index = find_memorytype_index(
&index_buffer_memory_req, &index_buffer_memory_req,
&base.device_memory_properties, &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."); .expect("Unable to find suitable memorytype for the index buffer.");
let index_allocate_info = vk::MemoryAllocateInfo { let index_allocate_info = vk::MemoryAllocateInfo {
@ -178,7 +178,7 @@ fn main() {
let vertex_input_buffer_memory_index = find_memorytype_index( let vertex_input_buffer_memory_index = find_memorytype_index(
&vertex_input_buffer_memory_req, &vertex_input_buffer_memory_req,
&base.device_memory_properties, &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."); .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( let uniform_color_buffer_memory_index = find_memorytype_index(
&uniform_color_buffer_memory_req, &uniform_color_buffer_memory_req,
&base.device_memory_properties, &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."); .expect("Unable to find suitable memorytype for the vertex buffer.");
@ -281,7 +281,7 @@ fn main() {
let image_buffer_memory_index = find_memorytype_index( let image_buffer_memory_index = find_memorytype_index(
&image_buffer_memory_req, &image_buffer_memory_req,
&base.device_memory_properties, &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."); .expect("Unable to find suitable memorytype for the vertex buffer.");

View file

@ -100,7 +100,7 @@ fn main() {
let index_buffer_memory_index = find_memorytype_index( let index_buffer_memory_index = find_memorytype_index(
&index_buffer_memory_req, &index_buffer_memory_req,
&base.device_memory_properties, &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."); .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( let vertex_input_buffer_memory_index = find_memorytype_index(
&vertex_input_buffer_memory_req, &vertex_input_buffer_memory_req,
&base.device_memory_properties, &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."); .expect("Unable to find suitable memorytype for the vertex buffer.");