18template <
typename TAttachmentReferenceType>
20 :
public TAttachmentReferenceType
116template <
typename TSubpassDescriptionType>
123 :
public VkSubpassDescription
139 if (ResolveAttachmentReferences.Num() > 0)
175 :
public VkSubpassDescription2
192 if (ResolveAttachmentReferences.Num() > 0)
230template <
typename TSubpassDependencyType>
232 :
public TSubpassDependencyType
238 :
public VkSubpassDependency
248 :
public VkSubpassDependency2
257template<
typename TAttachmentDescriptionType>
264 :
public VkAttachmentDescription
304 :
public VkAttachmentDescription2
354 :
public VkRenderPassCreateInfo
375 :
public VkRenderPassFragmentDensityMapCreateInfoEXT
384 :
public VkRenderPassMultiviewCreateInfo
394 :
public VkRenderPassCreateInfo2
416 :
public VkFragmentShadingRateAttachmentInfoKHR
433 :
public VkSubpassDescriptionDepthStencilResolveKHR
467 return NumUsedClearValues;
480 uint32 NumUsedClearValues;
486template <
typename TSubpassDescriptionClass,
typename TSubpassDependencyClass,
typename TAttachmentReferenceClass,
typename TAttachmentDescriptionClass,
typename TRenderPassCreateInfoClass>
498 uint32 NumDependencies = 0;
505 &&
RTLayout.GetFragmentDensityAttachmentReference() !=
nullptr
510 RTLayout.GetHasDepthStencilResolve();
518 ShadingRateAttachmentReference.
SetAttachment(*
RTLayout.GetFragmentDensityAttachmentReference(), VkImageAspectFlagBits::VK_IMAGE_ASPECT_COLOR_BIT);
519 FragmentShadingRateAttachmentInfo.
SetReference(&ShadingRateAttachmentReference);
524 DepthStencilResolveAttachmentReference.
SetAttachment(*
RTLayout.GetDepthStencilResolveAttachmentReference(), VkImageAspectFlagBits::VK_IMAGE_ASPECT_NONE);
528 DepthStencilResolveSubpassDesc.
SetReference(&DepthStencilResolveAttachmentReference);
536 if (
RTLayout.GetResolveAttachmentReferences() !=
nullptr)
543 if (bCustomResolveSubpass && (NumColorAttachments > 1))
545 NumColorAttachments--;
557 DepthStencilAttachment.attachment =
RTLayout.GetDepthAttachmentReference()->attachment;
582 SubpassDesc.SetColorAttachments(ColorAttachmentReferences, NumColorAttachments);
586 SubpassDesc.SetDepthStencilAttachment(&DepthStencilAttachmentReference);
591 SubpassDesc.SetDepthStencilResolveAttachment(&DepthStencilResolveSubpassDesc);
596 SubpassDesc.SetShadingRateAttachment(&FragmentShadingRateAttachmentInfo);
606 SubpassDesc.SetColorAttachments(ColorAttachmentReferences, 1);
614 SubpassDesc.SetInputAttachments(InputAttachments1, InputAttachment1Count);
616 SubpassDesc.SetDepthStencilAttachment(&DepthStencilAttachment);
620 SubpassDesc.SetDepthStencilResolveAttachment(&DepthStencilResolveSubpassDesc);
625 SubpassDesc.SetShadingRateAttachment(&FragmentShadingRateAttachmentInfo);
649 SubpassDesc.SetColorAttachments(ColorAttachmentReferences);
650 SubpassDesc.SetDepthStencilAttachment(&DepthStencilAttachment);
654 SubpassDesc.SetInputAttachments(InputAttachments1, InputAttachment1Count);
658 SubpassDesc.SetShadingRateAttachment(&FragmentShadingRateAttachmentInfo);
676 SubpassDesc.SetColorAttachments(ColorAttachmentReferences, 1);
677 SubpassDesc.SetDepthStencilAttachment(&DepthStencilAttachment);
687 InputAttachments2[1].SetAspect(0);
693 InputAttachments2[i].attachment = ColorAttachmentReferences[i - 1].attachment;
701 SubpassDesc.SetShadingRateAttachment(&FragmentShadingRateAttachmentInfo);
722 if (bCustomResolveSubpass)
725 ColorAttachments3[0].attachment = ColorAttachmentReferences[1].attachment;
731 InputAttachments3[0].SetAspect(0);
733 InputAttachments3[1].attachment = ColorAttachmentReferences[0].attachment;
737 SubpassDesc.SetDepthStencilAttachment(&DepthStencilAttachment);
741 SubpassDesc.SetDepthStencilResolveAttachment(&DepthStencilResolveSubpassDesc);
744 SubpassDesc.SetInputAttachments(InputAttachments3, 2);
761 if (!bCustomResolveSubpass)
769 Swap(ResolveAttachmentReferences.
Last(), ResolveAttachmentReferences[0]);
777 SubpassDescriptions[
NumSubpasses - 1].SetResolveAttachments(ResolveAttachmentReferences);
781 for (
uint32 Attachment = 0; Attachment <
RTLayout.GetNumAttachmentDescriptions(); ++Attachment)
793 CreateInfo.attachmentCount = AttachmentDescriptions.
Num();
794 CreateInfo.pAttachments = AttachmentDescriptions.
GetData();
796 CreateInfo.pSubpasses = SubpassDescriptions;
797 CreateInfo.dependencyCount = NumDependencies;
798 CreateInfo.pDependencies = SubpassDependencies;
817 CreateInfo.SetCorrelationMask(&CorrelationMask);
823 MultiviewInfo.pViewMasks = ViewMask;
824 MultiviewInfo.dependencyCount = 0;
825 MultiviewInfo.pViewOffsets =
nullptr;
826 MultiviewInfo.correlationMaskCount = 1;
827 MultiviewInfo.pCorrelationMasks = &CorrelationMask;
829 MultiviewInfo.pNext = CreateInfo.pNext;
830 CreateInfo.pNext = &MultiviewInfo;
836 FragDensityCreateInfo.fragmentDensityMapAttachment = *
RTLayout.GetFragmentDensityAttachmentReference();
840 FragDensityCreateInfo.pNext = CreateInfo.pNext;
841 CreateInfo.pNext = &FragDensityCreateInfo;
849 return CreateInfo.Create(Device);
865 static const uint32 InputAttachment1Count = 1;
951 struct FFramebufferList
GLenum attachment
Definition AndroidOpenGLFunctions.h:46
#define check(expr)
Definition AssertionMacros.h:314
#define checkNoEntry()
Definition AssertionMacros.h:316
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ MaxSimultaneousRenderTargets
Definition RHIDefinitions.h:287
#define GRHISupportsDepthStencilResolve
Definition RHIGlobals.h:918
#define GRHIVariableRateShadingImageTileMinWidth
Definition RHIGlobals.h:889
#define GRHISupportsAttachmentVariableRateShading
Definition RHIGlobals.h:884
#define GRHIVariableRateShadingImageTileMinHeight
Definition RHIGlobals.h:890
@ SLT_ReadOnly
Definition ScopeRWLock.h:138
@ SLT_Write
Definition ScopeRWLock.h:139
#define VULKAN_CPU_ALLOCATOR
Definition VulkanConfiguration.h:232
int32 GVulkanInputAttachmentShaderRead
Definition VulkanRHI.cpp:73
VkRenderPass CreateVulkanRenderPass(FVulkanDevice &Device, const FVulkanRenderTargetLayout &RTLayout)
Definition VulkanRenderpass.cpp:8
#define VERIFYVULKANRESULT_EXPANDED(VkFunction)
Definition VulkanUtil.h:33
Definition RHIResources.h:4167
Definition ScopeRWLock.h:199
Definition VulkanContext.h:241
Definition VulkanDevice.h:279
const FOptionalVulkanDeviceExtensionProperties & GetOptionalExtensionProperties() const
Definition VulkanDevice.h:545
VkDevice GetHandle() const
Definition VulkanDevice.h:425
bool SupportsParallelRendering() const
Definition VulkanDevice.h:555
const FOptionalVulkanDeviceExtensions & GetOptionalExtensions() const
Definition VulkanDevice.h:540
Definition VulkanFramebuffer.h:8
Definition VulkanPipeline.h:492
Definition VulkanRenderpass.h:488
FVulkanRenderPassBuilder(FVulkanDevice &InDevice)
Definition VulkanRenderpass.h:490
TRenderPassCreateInfoClass & GetCreateInfo()
Definition VulkanRenderpass.h:852
void BuildCreateInfo(const FVulkanRenderTargetLayout &RTLayout)
Definition VulkanRenderpass.h:495
VkRenderPass Create(const FVulkanRenderTargetLayout &RTLayout)
Definition VulkanRenderpass.h:845
Definition VulkanRenderpass.h:906
void BeginRenderPass(FVulkanCommandListContext &Context, const FRHIRenderPassInfo &RPInfo, const FVulkanRenderTargetLayout &RTLayout, const FVulkanBeginRenderPassInfo &BeginRenderPassInfo)
Definition VulkanRenderpass.cpp:124
void NotifyDeletedRenderTarget(VkImage Image)
Definition VulkanRenderpass.cpp:222
~FVulkanRenderPassManager()
Definition VulkanRenderpass.cpp:28
FVulkanRenderPass * GetOrCreateRenderPass(const FVulkanRenderTargetLayout &RTLayout)
Definition VulkanRenderpass.h:912
void EndRenderPass(FVulkanCommandListContext &Context)
Definition VulkanRenderpass.cpp:214
FRWLock FramebuffersLock
Definition VulkanRenderpass.h:943
FVulkanFramebuffer * GetOrCreateFramebuffer(const FRHISetRenderTargetsInfo &RenderTargetsInfo, const FVulkanRenderTargetLayout &RTLayout, FVulkanRenderPass &RenderPass)
Definition VulkanRenderpass.cpp:52
FVulkanRenderPassManager(FVulkanDevice &InDevice)
Definition VulkanRenderpass.h:908
FRWLock RenderPassesLock
Definition VulkanRenderpass.h:942
Definition VulkanRenderpass.h:453
const FVulkanRenderTargetLayout & GetLayout() const
Definition VulkanRenderpass.h:455
uint32 GetNumUsedClearValues() const
Definition VulkanRenderpass.h:465
VkRenderPass GetHandle() const
Definition VulkanRenderpass.h:460
Definition VulkanRenderTargetLayout.h:8
Definition VulkanRenderpass.h:118
Definition ArrayView.h:139
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType & Last(SizeType IndexFromTheEnd=0) UE_LIFETIMEBOUND
Definition Array.h:1263
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition UnrealString.h.inl:34
Definition VulkanCommandBuffer.h:22
VkImageLayout GetMergedDepthStencilLayout(VkImageLayout DepthLayout, VkImageLayout StencilLayout)
Definition VulkanRHIPrivate.h:510
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131
VkPhysicalDeviceFragmentShadingRateFeaturesKHR FragmentShadingRateFeatures
Definition VulkanDevice.h:167
uint64 HasKHRMultiview
Definition VulkanDevice.h:78
uint64 HasKHRDepthStencilResolve
Definition VulkanDevice.h:95
uint64 HasKHRRenderPass2
Definition VulkanDevice.h:83
uint64 HasKHRFragmentShadingRate
Definition VulkanDevice.h:51
uint64 HasEXTFragmentDensityMap
Definition VulkanDevice.h:49
Definition RHIResources.h:5248
FVulkanAttachmentDescription(const VkAttachmentDescription &InDesc)
Definition VulkanRenderpass.h:311
FVulkanAttachmentDescription(const VkAttachmentDescription &InDesc, const VkAttachmentDescriptionStencilLayout *InStencilDesc, bool bSupportsParallelRendering)
Definition VulkanRenderpass.h:326
FVulkanAttachmentDescription()
Definition VulkanRenderpass.h:306
FVulkanAttachmentDescription(const VkAttachmentDescription &InDesc, const VkAttachmentDescriptionStencilLayout *InStencilDesc, bool bSupportsParallelRendering)
Definition VulkanRenderpass.h:284
FVulkanAttachmentDescription()
Definition VulkanRenderpass.h:266
FVulkanAttachmentDescription(const VkAttachmentDescription &InDesc)
Definition VulkanRenderpass.h:271
Definition VulkanRenderpass.h:259
Definition VulkanRenderpass.h:21
void SetAttachment(const VkAttachmentReference &AttachmentReferenceIn, VkImageAspectFlags AspectMask)
Definition VulkanRenderpass.h:32
void SetDepthStencilAttachment(const VkAttachmentReference &AttachmentReferenceIn, const VkAttachmentReferenceStencilLayout *StencilReference, VkImageAspectFlags AspectMask, bool bSupportsParallelRendering)
Definition VulkanRenderpass.h:34
void SetAttachment(const FVulkanAttachmentReference< TAttachmentReferenceType > &AttachmentReferenceIn, VkImageAspectFlags AspectMask)
Definition VulkanRenderpass.h:33
void SetAspect(uint32 Aspect)
Definition VulkanRenderpass.h:36
void ZeroStruct()
Definition VulkanRenderpass.h:35
FVulkanAttachmentReference()
Definition VulkanRenderpass.h:22
FVulkanAttachmentReference(const VkAttachmentReference &AttachmentReferenceIn, VkImageAspectFlags AspectMask)
Definition VulkanRenderpass.h:27
Definition VulkanRenderpass.h:899
FVulkanRenderPass & RenderPass
Definition VulkanRenderpass.h:900
FVulkanFramebuffer & Framebuffer
Definition VulkanRenderpass.h:901
bool bIsParallelRenderPass
Definition VulkanRenderpass.h:902
Definition VulkanRenderpass.h:434
void SetReference(FVulkanAttachmentReference< VkAttachmentReference2 > *AttachmentReference)
Definition VulkanRenderpass.h:446
void SetResolveModes(VkResolveModeFlagBits DepthMode, VkResolveModeFlagBits StencilMode)
Definition VulkanRenderpass.h:440
FVulkanDepthStencilResolveSubpassDesc()
Definition VulkanRenderpass.h:435
Definition VulkanRenderpass.h:417
FVulkanFragmentShadingRateAttachmentInfo()
Definition VulkanRenderpass.h:418
void SetReference(FVulkanAttachmentReference< VkAttachmentReference2 > *AttachmentReference)
Definition VulkanRenderpass.h:426
FVulkanRenderPassCreateInfo()
Definition VulkanRenderpass.h:396
VkRenderPass Create(FVulkanDevice &Device)
Definition VulkanRenderpass.h:407
void SetCorrelationMask(const uint32_t *MaskPtr)
Definition VulkanRenderpass.h:401
void SetCorrelationMask(const uint32_t *MaskPtr)
Definition VulkanRenderpass.h:361
VkRenderPass Create(FVulkanDevice &Device)
Definition VulkanRenderpass.h:366
FVulkanRenderPassCreateInfo()
Definition VulkanRenderpass.h:356
Definition VulkanRenderpass.h:350
Definition VulkanRenderpass.h:376
FVulkanRenderPassFragmentDensityMapCreateInfoEXT()
Definition VulkanRenderpass.h:377
Definition VulkanRenderpass.h:385
FVulkanRenderPassMultiviewCreateInfo()
Definition VulkanRenderpass.h:386
FVulkanSubpassDependency()
Definition VulkanRenderpass.h:250
FVulkanSubpassDependency()
Definition VulkanRenderpass.h:240
Definition VulkanRenderpass.h:233
void SetShadingRateAttachment(VkFragmentShadingRateAttachmentInfoKHR *ShadingRateAttachmentInfo)
Definition VulkanRenderpass.h:217
void SetColorAttachments(const TArray< FVulkanAttachmentReference< VkAttachmentReference2 > > &ColorAttachmentReferences, int OverrideCount=-1)
Definition VulkanRenderpass.h:184
void SetInputAttachments(FVulkanAttachmentReference< VkAttachmentReference2 > *InputAttachmentReferences, uint32 NumInputAttachmentReferences)
Definition VulkanRenderpass.h:204
void SetDepthStencilResolveAttachment(VkSubpassDescriptionDepthStencilResolveKHR *DepthStencilResolveAttachmentDesc)
Definition VulkanRenderpass.h:210
void SetResolveAttachments(const TArrayView< FVulkanAttachmentReference< VkAttachmentReference2 > > &ResolveAttachmentReferences)
Definition VulkanRenderpass.h:190
void SetDepthStencilAttachment(FVulkanAttachmentReference< VkAttachmentReference2 > *DepthStencilAttachmentReference)
Definition VulkanRenderpass.h:199
FVulkanSubpassDescription()
Definition VulkanRenderpass.h:177
void SetMultiViewMask(uint32_t Mask)
Definition VulkanRenderpass.h:224
FVulkanSubpassDescription()
Definition VulkanRenderpass.h:125
void SetColorAttachments(const TArray< FVulkanAttachmentReference< VkAttachmentReference > > &ColorAttachmentReferences, int OverrideCount=-1)
Definition VulkanRenderpass.h:131
void SetDepthStencilAttachment(FVulkanAttachmentReference< VkAttachmentReference > *DepthStencilAttachmentReference)
Definition VulkanRenderpass.h:146
void SetInputAttachments(FVulkanAttachmentReference< VkAttachmentReference > *InputAttachmentReferences, uint32 NumInputAttachmentReferences)
Definition VulkanRenderpass.h:151
void SetMultiViewMask(uint32_t Mask)
Definition VulkanRenderpass.h:167
void SetResolveAttachments(const TArrayView< FVulkanAttachmentReference< VkAttachmentReference > > &ResolveAttachmentReferences)
Definition VulkanRenderpass.h:137
void SetShadingRateAttachment(VkFragmentShadingRateAttachmentInfoKHR *)
Definition VulkanRenderpass.h:162
void SetDepthStencilResolveAttachment(VkSubpassDescriptionDepthStencilResolveKHR *DepthStencilResolveAttachmentDesc)
Definition VulkanRenderpass.h:157