File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Graphics/GraphicsEngine/src Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,42 @@ void ValidateFramebufferDesc(const FramebufferDesc& Desc) noexcept(false)
114114 {
115115 LOG_FRAMEBUFFER_ERROR_AND_THROW (" memoryless attachment " , i, " is not compatible with ATTACHMENT_STORE_OP_STORE" );
116116 }
117+
118+ #if PLATFORM_MACOS || PLATFORM_IOS
119+ {
120+ Uint32 NumSubpasses = 0 ;
121+ for (Uint32 s = 0 ; s < RPDesc.SubpassCount ; ++s)
122+ {
123+ const auto & Subpass = RPDesc.pSubpasses [s];
124+
125+ bool UsedInSubpass = false ;
126+ for (Uint32 rt_attachment = 0 ; rt_attachment < Subpass.RenderTargetAttachmentCount ; ++rt_attachment)
127+ {
128+ const auto & AttchRef = Subpass.pRenderTargetAttachments [rt_attachment];
129+ if (AttchRef.AttachmentIndex == i)
130+ UsedInSubpass = true ;
131+ }
132+ for (Uint32 input_attachment = 0 ; input_attachment < Subpass.InputAttachmentCount ; ++input_attachment)
133+ {
134+ const auto & AttchRef = Subpass.pInputAttachments [input_attachment];
135+ if (AttchRef.AttachmentIndex == i)
136+ UsedInSubpass = true ;
137+ }
138+ if (Subpass.pDepthStencilAttachment != nullptr && Subpass.pDepthStencilAttachment ->AttachmentIndex == i)
139+ UsedInSubpass = true ;
140+
141+ if (UsedInSubpass)
142+ ++NumSubpasses;
143+ }
144+ if (NumSubpasses > 1 )
145+ {
146+ LOG_FRAMEBUFFER_ERROR_AND_THROW (" memoryless attachment " , i,
147+ " is used in more than one subpass, which is not supported on MacOS/iOS "
148+ " as the contents of the attachment can't be preserved between subpasses without "
149+ " storing it in global memory." );
150+ }
151+ }
152+ #endif
117153 }
118154 }
119155
You can’t perform that action at this time.
0 commit comments