Skip to content

Commit f7529d0

Browse files
author
sjfricke
committed
added HOST_COHERENT_BIT to vertex memory
From the Vulkan spec we need to add HOST_COHERENT as it says: If a memory object does not have the VK_MEMORY_PROPERTY_HOST_COHERENT_BIT property, then vkFlushMappedMemoryRanges must be called in order to guarantee that writes to the memory object from the host are made visible to the VK_ACCESS_HOST_WRITE_BIT access type, where it can be further made available to the device by synchronization commands
1 parent dac816f commit f7529d0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tutorial05_triangle/app/src/main/jni/VulkanMain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ bool CreateBuffers(void) {
383383

384384
// Assign the proper memory type for that buffer
385385
MapMemoryTypeToIndex(memReq.memoryTypeBits,
386-
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
386+
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
387+
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
387388
&allocInfo.memoryTypeIndex);
388389

389390
// Allocate memory for the buffer

tutorial06_texture/app/src/main/cpp/VulkanMain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,8 @@ bool CreateBuffers(void) {
708708

709709
// Assign the proper memory type for that buffer
710710
MapMemoryTypeToIndex(memReq.memoryTypeBits,
711-
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
711+
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
712+
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
712713
&allocInfo.memoryTypeIndex);
713714

714715
// Allocate memory for the buffer

0 commit comments

Comments
 (0)