Skip to content

Commit

Permalink
Use non cached memory type
Browse files Browse the repository at this point in the history
  • Loading branch information
xCollateral committed Nov 24, 2024
1 parent 100fde1 commit 1bbd0ac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/net/vulkanmod/vulkan/memory/MemoryTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static void createMemoryTypes() {
}

if (propertyFlags == (VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) {
HOST_MEM = new HostLocalCachedMemory(memoryType, heap);
HOST_MEM = new HostCoherentMemory(memoryType, heap);
}
}

Expand Down Expand Up @@ -119,18 +119,17 @@ boolean mappable() {
}
}

static class HostLocalCachedMemory extends MappableMemory {
static class HostCoherentMemory extends MappableMemory {

HostLocalCachedMemory(VkMemoryType vkMemoryType, VkMemoryHeap vkMemoryHeap) {
HostCoherentMemory(VkMemoryType vkMemoryType, VkMemoryHeap vkMemoryHeap) {
super(Type.HOST_LOCAL, vkMemoryType, vkMemoryHeap);
}

@Override
void createBuffer(Buffer buffer, long size) {

MemoryManager.getInstance().createBuffer(buffer, size,
VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | buffer.usage,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT);
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
}

}
Expand Down

0 comments on commit 1bbd0ac

Please sign in to comment.