changeset 616:83e990b0eb6a

fix: more improvment for memory selection
author Sam <sam@basx.dev>
date Thu, 27 Apr 2023 21:16:13 +0700
parents 91e6b2935934
children f7e7af33e9ee
files src/semicongine/vulkan/buffer.nim
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/semicongine/vulkan/buffer.nim	Thu Apr 27 21:13:09 2023 +0700
+++ b/src/semicongine/vulkan/buffer.nim	Thu Apr 27 21:16:13 2023 +0700
@@ -47,7 +47,8 @@
   buffer.memoryAllocated = true
   debug "Allocating memory for buffer: ", buffer.size, " bytes ", flags
   buffer.memory = buffer.device.allocate(buffer.size, flags)
-  checkVkResult buffer.device.vk.vkBindBufferMemory(buffer.vk, buffer.memory.vk, VkDeviceSize(0))
+  if buffer.memory.canMap:
+    checkVkResult buffer.device.vk.vkBindBufferMemory(buffer.vk, buffer.memory.vk, VkDeviceSize(0))
 
 
 # currently no support for extended structure and concurrent/shared use