comparison src/semicongine/vulkan/buffer.nim @ 614:a54a7fe28430

add: more logging
author Sam <sam@basx.dev>
date Thu, 27 Apr 2023 20:55:02 +0700
parents a21748450a81
children 91e6b2935934
comparison
equal deleted inserted replaced
613:40f5d804eca6 614:a54a7fe28430
1 import std/strformat 1 import std/strformat
2 import std/typetraits 2 import std/typetraits
3 import std/sequtils 3 import std/sequtils
4 import std/tables 4 import std/tables
5 import std/logging
5 6
6 import ./api 7 import ./api
7 import ./device 8 import ./device
8 import ./memory 9 import ./memory
9 import ./physicaldevice 10 import ./physicaldevice
40 41
41 if autoFlush and buffer.device.hasMemoryWith(flags & @[VK_MEMORY_PROPERTY_HOST_COHERENT_BIT]): 42 if autoFlush and buffer.device.hasMemoryWith(flags & @[VK_MEMORY_PROPERTY_HOST_COHERENT_BIT]):
42 flags.add VK_MEMORY_PROPERTY_HOST_COHERENT_BIT 43 flags.add VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
43 44
44 buffer.memoryAllocated = true 45 buffer.memoryAllocated = true
46 debug "Allocating memory for buffer: ", buffer.size, " bytes ", flags
45 buffer.memory = buffer.device.allocate(buffer.size, flags) 47 buffer.memory = buffer.device.allocate(buffer.size, flags)
46 checkVkResult buffer.device.vk.vkBindBufferMemory(buffer.vk, buffer.memory.vk, VkDeviceSize(0)) 48 checkVkResult buffer.device.vk.vkBindBufferMemory(buffer.vk, buffer.memory.vk, VkDeviceSize(0))
47 49
48 50
49 # currently no support for extended structure and concurrent/shared use 51 # currently no support for extended structure and concurrent/shared use