15 #include <vsg/commands/Command.h>
16 #include <vsg/core/ScratchMemory.h>
17 #include <vsg/state/Buffer.h>
18 #include <vsg/state/Image.h>
35 VkAccessFlags in_dstAccessMask = 0) :
36 srcAccessMask(in_srcAccessMask),
37 dstAccessMask(in_dstAccessMask) {}
40 VkAccessFlags srcAccessMask = 0;
41 VkAccessFlags dstAccessMask = 0;
43 void assign(
CommandBuffer& commandBuffer, VkMemoryBarrier& info)
const;
46 using MemoryBarriers = std::vector<ref_ptr<MemoryBarrier>>;
52 VkAccessFlags in_dstAccessMask = 0,
53 uint32_t in_srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
54 uint32_t in_dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
56 VkDeviceSize in_offset = 0,
57 VkDeviceSize in_size = 0) :
58 srcAccessMask(in_srcAccessMask),
59 dstAccessMask(in_dstAccessMask),
60 srcQueueFamilyIndex(in_srcQueueFamilyIndex),
61 dstQueueFamilyIndex(in_dstQueueFamilyIndex),
67 VkAccessFlags srcAccessMask = 0;
68 VkAccessFlags dstAccessMask = 0;
69 uint32_t srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
70 uint32_t dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
72 VkDeviceSize offset = 0;
73 VkDeviceSize size = 0;
75 void assign(
CommandBuffer& commandBuffer, VkBufferMemoryBarrier& info)
const;
78 using BufferMemoryBarriers = std::vector<ref_ptr<BufferMemoryBarrier>>;
84 VkAccessFlags in_dstAccessMask = 0,
85 VkImageLayout in_oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
86 VkImageLayout in_newLayout = VK_IMAGE_LAYOUT_UNDEFINED,
87 uint32_t in_srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
88 uint32_t in_dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
90 VkImageSubresourceRange in_subresourceRange = {0, 0, 0, 0, 0}) :
91 srcAccessMask(in_srcAccessMask),
92 dstAccessMask(in_dstAccessMask),
93 oldLayout(in_oldLayout),
94 newLayout(in_newLayout),
95 srcQueueFamilyIndex(in_srcQueueFamilyIndex),
96 dstQueueFamilyIndex(in_dstQueueFamilyIndex),
98 subresourceRange(in_subresourceRange) {}
101 VkAccessFlags srcAccessMask = 0;
102 VkAccessFlags dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
103 VkImageLayout oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
104 VkImageLayout newLayout = VK_IMAGE_LAYOUT_UNDEFINED;
105 uint32_t srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
106 uint32_t dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
108 VkImageSubresourceRange subresourceRange = {0, 0, 0, 0, 0};
110 void assign(
CommandBuffer& commandBuffer, VkImageMemoryBarrier& info)
const;
113 using ImageMemoryBarriers = std::vector<ref_ptr<ImageMemoryBarrier>>;
118 VkSampleCountFlagBits sampleLocationsPerPixel = VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM;
119 VkExtent2D sampleLocationGridSize = {0, 0};
120 std::vector<vec2> sampleLocations;
131 template<
typename... Args>
132 PipelineBarrier(VkPipelineStageFlags in_srcStageMask, VkPipelineStageFlags in_destStageMask, VkDependencyFlags in_dependencyFlags, Args&&... args) :
133 srcStageMask(in_srcStageMask),
134 dstStageMask(in_destStageMask),
135 dependencyFlags(in_dependencyFlags)
146 VkPipelineStageFlags srcStageMask;
147 VkPipelineStageFlags dstStageMask;
148 VkDependencyFlags dependencyFlags;
150 MemoryBarriers memoryBarriers;
151 BufferMemoryBarriers bufferMemoryBarriers;
152 ImageMemoryBarriers imageMemoryBarriers;
CommandBuffer encapsulates VkCommandBuffer.
Definition: CommandBuffer.h:27
PipelineBarrier command encapsulates vkCmdPipelineBarrier call and associated lists of MemoryBarrier,...
Definition: PipelineBarrier.h:127
BufferMemoryBarrier encapsulates VkBufferMemoryBarrier settings.
Definition: PipelineBarrier.h:50
ImageMemoryBarrier encapsulates vkImageMemoryBarrier settings.
Definition: PipelineBarrier.h:82
MemoryBarrier encapsulates VkMemoryBarrier settings.
Definition: PipelineBarrier.h:33
SampleLocations encapsulates the VkSampleLocationsInfoEXT settings associated with VK_EXT_sample_loca...
Definition: PipelineBarrier.h:117
VulkanInfo is a base class for extensions assigned via next pointer in Vulkan structures.
Definition: PipelineBarrier.h:25