15 #include <vsg/vk/Device.h>
22 VkAttachmentDescriptionFlags flags;
24 VkSampleCountFlagBits samples;
25 VkAttachmentLoadOp loadOp;
26 VkAttachmentStoreOp storeOp;
27 VkAttachmentLoadOp stencilLoadOp;
28 VkAttachmentStoreOp stencilStoreOp;
29 VkImageLayout initialLayout;
30 VkImageLayout finalLayout;
37 uint32_t srcSubpass = 0;
38 uint32_t dstSubpass = 0;
39 VkPipelineStageFlags srcStageMask;
40 VkPipelineStageFlags dstStageMask;
41 VkAccessFlags srcAccessMask;
42 VkAccessFlags dstAccessMask;
43 VkDependencyFlags dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
53 uint32_t attachment = 0;
54 VkImageLayout layout = VK_IMAGE_LAYOUT_UNDEFINED;
64 VkSubpassDescriptionFlags flags = 0;
65 VkPipelineBindPoint pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
67 std::vector<AttachmentReference> inputAttachments;
68 std::vector<AttachmentReference> colorAttachments;
69 std::vector<AttachmentReference> resolveAttachments;
70 std::vector<AttachmentReference> depthStencilAttachments;
72 std::vector<uint32_t> preserveAttachments;
79 VkResolveModeFlagBits stencilResolveMode = VK_RESOLVE_MODE_NONE;
80 std::vector<AttachmentReference> depthStencilResolveAttachments;
88 using Attachments = std::vector<AttachmentDescription>;
89 using Subpasses = std::vector<SubpassDescription>;
90 using Dependencies = std::vector<SubpassDependency>;
91 using CorrelatedViewMasks = std::vector<uint32_t>;
93 RenderPass(
Device* in_device,
const Attachments& in_attachments,
const Subpasses& in_subpasses,
const Dependencies& in_dependencies,
const CorrelatedViewMasks& in_correlatedViewMasks = {});
95 operator VkRenderPass()
const {
return _renderPass; }
96 VkRenderPass vk()
const {
return _renderPass; }
100 const Attachments attachments;
101 const Subpasses subpasses;
102 const Dependencies dependencies;
103 const CorrelatedViewMasks correlatedViewMasks;
121 extern VSG_DECLSPEC
ref_ptr<RenderPass> createRenderPass(
Device* device, VkFormat imageFormat, VkFormat depthFormat,
bool requiresDepthRead =
false);
124 extern VSG_DECLSPEC
ref_ptr<RenderPass> createMultisampledRenderPass(
Device* device, VkFormat imageFormat, VkFormat depthFormat, VkSampleCountFlagBits samples,
bool requiresDepthRead =
false);
130 extern VSG_DECLSPEC
ref_ptr<RenderPass> createMultisampledRenderPass(
Device* device, VkFormat imageFormat, VkSampleCountFlagBits samples);
Device encapsulates VkDevice, a logical handle to the PhysicalDevice with capabilities specified duri...
Definition: Device.h:37
RenderPass encapsulation of VkRenderPass.
Definition: RenderPass.h:86
const VkSampleCountFlagBits maxSamples
Definition: RenderPass.h:107
VkRenderPass _renderPass
Vulkan renderPass handle, created in RenderPass constructor.
Definition: RenderPass.h:113
AttachmentDescription is used by RenderPass to specify VkAttachmentDescription settings.
Definition: RenderPass.h:21
AttachmentReference is used by RenderPass to specify VkAttachmentReference settings.
Definition: RenderPass.h:52
VkImageAspectFlags aspectMask
multiview support requires Vulkan 1.2 or later.
Definition: RenderPass.h:57
SubpassDependency is used by RenderPass to specify VkSubpassDependency settings.
Definition: RenderPass.h:36
int32_t viewOffset
multiview support requires Vulkan 1.2 or later.
Definition: RenderPass.h:46
SubpassDescription is used by RenderPass to specify VkSubpassDescription settings.
Definition: RenderPass.h:63
VkResolveModeFlagBits depthResolveMode
maps to VkSubpassDescriptionDepthStencilResolve, requires Vulkan 1.2 or later or an extension.
Definition: RenderPass.h:78
uint32_t viewMask
multiview support requires Vulkan 1.2 or later.
Definition: RenderPass.h:75