15#include <vsg/state/Buffer.h>
31 BufferInfo(
Buffer* in_buffer, VkDeviceSize in_offset, VkDeviceSize in_range,
Data* in_data =
nullptr);
49 explicit operator bool()
const {
return buffer.valid() && data.valid() && range != 0; }
52 VkDeviceSize offset = 0;
53 VkDeviceSize range = 0;
60 return data && data->differentModifiedCount(copiedModifiedCounts[deviceID]);
66 return data && data->getModifiedCount(copiedModifiedCounts[deviceID]);
76 using BufferInfoList = std::vector<ref_ptr<BufferInfo>>;
80 std::vector<VkBuffer> vkBuffers;
81 std::vector<VkDeviceSize> offsets;
85 extern VSG_DECLSPEC
void assignVulkanArrayData(uint32_t deviceID,
const BufferInfoList& arrays,
VulkanArrayData& vkd);
89 extern VSG_DECLSPEC
bool createBufferAndTransferData(
Context& context,
const BufferInfoList& bufferInfoList, VkBufferUsageFlags usage, VkSharingMode sharingMode);
91 extern VSG_DECLSPEC BufferInfoList createHostVisibleBuffer(
Device* device,
const DataList& dataList, VkBufferUsageFlags usage, VkSharingMode sharingMode);
93 extern VSG_DECLSPEC
void copyDataListToBuffers(
Device* device, BufferInfoList& bufferInfoList);
BufferInfo encapsulates the settings that map to VkDescriptorBufferInfo.
Definition BufferInfo.h:27
int compare(const Object &rhs_object) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
ref_ptr< Object > clone(const CopyOp ©op={}) const override
bool requiresCopy(uint32_t deviceID) const
return true if the BufferInfo's data has been modified and should be copied to the buffer
Definition BufferInfo.h:58
void copyDataToBuffer(uint32_t deviceID)
bool syncModifiedCounts(uint32_t deviceID)
return true if the BufferInfo's data has been modified and should be copied to the buffer,...
Definition BufferInfo.h:64
Device encapsulates VkDevice, a logical handle to the PhysicalDevice with capabilities specified duri...
Definition Device.h:37
Definition BufferInfo.h:79
vk_buffer that manages a single logical device supported.
Definition vk_buffer.h:28