15#include <vsg/vk/DeviceMemory.h>
16#include <vsg/vk/vk_buffer.h>
48 std::vector<uint32_t> queueFamilyIndices;
54 const DeviceMemory* getDeviceMemory(
uint32_t deviceID)
const {
return _vulkanData[deviceID].deviceMemory; }
56 VkDeviceSize getMemoryOffset(uint32_t deviceID)
const {
return _vulkanData[deviceID].memoryOffset; }
58 VkMemoryRequirements getMemoryRequirements(uint32_t deviceID)
const;
60 VkResult allocateAndBindMemory(Device* device, VkMemoryPropertyFlags memoryProperties = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
void* pNextAllocInfo =
nullptr);
62 VkResult bind(DeviceMemory* deviceMemory, VkDeviceSize memoryOffset);
65 bool requiresCopy(
uint32_t deviceID)
const {
return data && data->differentModifiedCount(_vulkanData[deviceID].copiedModifiedCount); }
70 virtual void compile(
Device* device);
71 virtual void compile(
Context& context);
83 bool requiresDataCopy =
false;
Device encapsulates VkDevice, a logical handle to the PhysicalDevice with capabilities specified duri...
Definition Device.h:37
Definition DeviceMemory.h:28
Image class encapsulates VkImage and VkImageCreateInfo settings used to set it up.
Definition Image.h:25
Image(VkImage image, Device *device)
create a vsg::Image wrapper for specified VkImage
VkImage vk(uint32_t deviceID) const
Vulkan VkImage handle.
Definition Image.h:34
bool requiresCopy(uint32_t deviceID) const
return true if the Image's data has been modified and should be copied to the buffer.
Definition Image.h:65
ref_ptr< Data > data
VkImageCreateInfo settings.
Definition Image.h:37
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,...
bool syncModifiedCount(uint32_t deviceID)
return true if the Image's data has been modified and should be copied to the buffer,...
Definition Image.h:68
Image(ref_ptr< Data > in_data={})
create a vsg::Image, optional Data is used to initialize createInfo, delay VkImage creation to compil...
ModifiedCount provides a count value to keep track of modifications to data.
Definition Data.h:29
std container adapter for allocating with MEMORY_AFFINITY_NODES
Definition Allocator.h:138