15 #include <vsg/vk/DeviceMemory.h>
16 #include <vsg/vk/vk_buffer.h>
28 Buffer(VkDeviceSize in_size, VkBufferUsageFlags in_usage, VkSharingMode in_sharingMode);
31 VkBuffer
vk(uint32_t deviceID)
const {
return _vulkanData[deviceID].buffer; }
34 VkBufferCreateFlags flags = 0;
36 VkBufferUsageFlags usage;
37 VkSharingMode sharingMode;
42 VkResult bind(
DeviceMemory* deviceMemory, VkDeviceSize memoryOffset);
44 MemorySlots::OptionalOffset reserve(VkDeviceSize in_size, VkDeviceSize alignment);
45 void release(VkDeviceSize offset, VkDeviceSize in_size);
48 size_t maximumAvailableSpace()
const;
49 size_t totalAvailableSize()
const;
50 size_t totalReservedSize()
const;
52 VkMemoryRequirements getMemoryRequirements(uint32_t deviceID)
const;
54 DeviceMemory* getDeviceMemory(uint32_t deviceID) {
return _vulkanData[deviceID].deviceMemory; }
55 const DeviceMemory* getDeviceMemory(uint32_t deviceID)
const {
return _vulkanData[deviceID].deviceMemory; }
57 VkDeviceSize getMemoryOffset(uint32_t deviceID)
const {
return _vulkanData[deviceID].memoryOffset; }
59 virtual bool compile(Device* device);
60 virtual bool compile(Context& context);
67 VkBuffer buffer = VK_NULL_HANDLE;
69 VkDeviceSize memoryOffset = 0;
70 VkDeviceSize size = 0;
78 mutable std::mutex _mutex;
83 extern VSG_DECLSPEC
ref_ptr<Buffer> createBufferAndMemory(
Device* device, VkDeviceSize in_size, VkBufferUsageFlags in_usage, VkSharingMode in_sharingMode, VkMemoryPropertyFlags memoryProperties);
VkBuffer vk(uint32_t deviceID) const
Vulkan VkImage handle.
Definition: Buffer.h:31
uint32_t sizeVulkanData() const
return the number of VulkanData entries.
Definition: Buffer.h:40
Definition: DeviceMemory.h:28
Device encapsulates VkDevice, a logical handle to the PhysicalDevice with capabilities specified duri...
Definition: Device.h:37
Definition: MemorySlots.h:36
vk_buffer that manages a single logical device supported.
Definition: vk_buffer.h:28