changeset 161:1349f87ef083

add: debug output
author Sam <sam@basx.dev>
date Sat, 29 Apr 2023 17:36:09 +0700
parents 04f5e9a2eb43
children 68947a8ee127
files src/semicongine/vulkan/buffer.nim
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/semicongine/vulkan/buffer.nim	Sat Apr 29 17:30:15 2023 +0700
+++ b/src/semicongine/vulkan/buffer.nim	Sat Apr 29 17:36:09 2023 +0700
@@ -92,6 +92,7 @@
     pBuffer=addr result.vk
   )
   result.allocateMemory(requireMappable=requireMappable, preferVRAM=preferVRAM, preferAutoFlush=preferAutoFlush)
+  echo "New Buffer ", result
 
 
 proc copy*(src, dst: Buffer) =
@@ -119,6 +120,7 @@
     )
     copyRegion = VkBufferCopy(size: VkDeviceSize(src.size))
   checkVkResult commandBuffer.vkBeginCommandBuffer(addr(beginInfo))
+  echo "B ", dst
   commandBuffer.vkCmdCopyBuffer(src.vk, dst.vk, 1, addr(copyRegion))
   checkVkResult commandBuffer.vkEndCommandBuffer()
 
@@ -149,6 +151,7 @@
   else: # use staging buffer, slower but required if memory is not host visible
     var stagingBuffer = dst.device.createBuffer(size, [VK_BUFFER_USAGE_TRANSFER_SRC_BIT], requireMappable=true, preferVRAM=false, preferAutoFlush=true)
     stagingBuffer.setData(src, size, 0)
+    echo "B ", dst
     stagingBuffer.copy(dst)
     stagingBuffer.destroy()