Title: [275617] trunk/Source/ThirdParty/ANGLE
Revision
275617
Author
commit-qu...@webkit.org
Date
2021-04-07 12:00:32 -0700 (Wed, 07 Apr 2021)

Log Message

[METAL ANGLE] Interface block declerations need to have children marked as struct accesses. Add implicit backing textures for multisample render targets
https://bugs.webkit.org/show_bug.cgi?id=224265

Patch by John Cunningham <johncunnig...@apple.com> on 2021-04-07
Reviewed by Dean Jackson.

* src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.cpp:
* src/libANGLE/renderer/metal/FrameBufferMtl.h:
* src/libANGLE/renderer/metal/FrameBufferMtl.mm:
(rx::FramebufferMtl::setLoadStoreActionOnRenderPassFirstStart):
(rx::FramebufferMtl::onStartedDrawingToFrameBuffer):
* src/libANGLE/renderer/metal/RenderBufferMtl.mm:
(rx::RenderbufferMtl::setStorageImpl):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (275616 => 275617)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-04-07 18:23:36 UTC (rev 275616)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2021-04-07 19:00:32 UTC (rev 275617)
@@ -1,3 +1,18 @@
+2021-04-07  John Cunningham  <johncunnig...@apple.com>
+
+        [METAL ANGLE] Interface block declerations need to have children marked as struct accesses. Add implicit backing textures for multisample render targets
+        https://bugs.webkit.org/show_bug.cgi?id=224265
+
+        Reviewed by Dean Jackson.
+
+        * src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.cpp:
+        * src/libANGLE/renderer/metal/FrameBufferMtl.h:
+        * src/libANGLE/renderer/metal/FrameBufferMtl.mm:
+        (rx::FramebufferMtl::setLoadStoreActionOnRenderPassFirstStart):
+        (rx::FramebufferMtl::onStartedDrawingToFrameBuffer):
+        * src/libANGLE/renderer/metal/RenderBufferMtl.mm:
+        (rx::RenderbufferMtl::setStorageImpl):
+
 2021-04-05  Alex Christensen  <achristen...@webkit.org>
 
         Resurrect Mac CMake build

Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.cpp (275616 => 275617)


--- trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.cpp	2021-04-07 18:23:36 UTC (rev 275616)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/translator/TranslatorMetalDirect/ReduceInterfaceBlocks.cpp	2021-04-07 19:00:32 UTC (rev 275617)
@@ -86,7 +86,7 @@
             }
         }
 
-        return {declNode, VisitBits::Neither};
+        return {declNode, VisitBits::Both};
     }
 
     PreResult visitSymbolPre(TIntermSymbol &symbolNode) override

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.h (275616 => 275617)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.h	2021-04-07 18:23:36 UTC (rev 275616)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.h	2021-04-07 19:00:32 UTC (rev 275617)
@@ -154,7 +154,7 @@
 
     // Initialize load store options for a render pass's first start (i.e. not render pass resuming
     // from interruptions such as those caused by a conversion compute pass)
-    void setLoadStoreActionOnRenderPassFirstStart(mtl::RenderPassAttachmentDesc *attachmentOut);
+    void setLoadStoreActionOnRenderPassFirstStart(mtl::RenderPassAttachmentDesc *attachmentOut, const bool forceDepthStencilMultisampleLoad);
 
     // Fill RenderPassDesc with relevant attachment's info from GL front end.
     angle::Result prepareRenderPass(const gl::Context *context, mtl::RenderPassDesc *descOut);

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm (275616 => 275617)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm	2021-04-07 18:23:36 UTC (rev 275616)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/FrameBufferMtl.mm	2021-04-07 19:00:32 UTC (rev 275617)
@@ -731,14 +731,15 @@
 }
 
 void FramebufferMtl::setLoadStoreActionOnRenderPassFirstStart(
-    mtl::RenderPassAttachmentDesc *attachmentOut)
+    mtl::RenderPassAttachmentDesc *attachmentOut, const bool forceDepthStencilMultisampleLoad)
 {
     ASSERT(mRenderPassCleanStart);
 
     mtl::RenderPassAttachmentDesc &attachment = *attachmentOut;
 
-    if (attachment.storeAction == MTLStoreActionDontCare ||
-        attachment.storeAction == MTLStoreActionMultisampleResolve)
+    if (!forceDepthStencilMultisampleLoad &&
+       (attachment.storeAction == MTLStoreActionDontCare ||
+        attachment.storeAction == MTLStoreActionMultisampleResolve))
     {
         // If we previously discarded attachment's content, then don't need to load it.
         attachment.loadAction = MTLLoadActionDontCare;
@@ -750,17 +751,7 @@
 
     if (attachment.hasImplicitMSTexture())
     {
-        if (mBackbuffer)
-        {
-            // Default action for default framebuffer is resolve and keep MS texture's content.
-            // We only discard MS texture's content at the end of the frame. See onFrameEnd().
-            attachment.storeAction = MTLStoreActionStoreAndMultisampleResolve;
-        }
-        else
-        {
-            // Default action is resolve but don't keep MS texture's content.
-            attachment.storeAction = MTLStoreActionMultisampleResolve;
-        }
+        attachment.storeAction = MTLStoreActionStoreAndMultisampleResolve;
     }
     else
     {
@@ -772,16 +763,20 @@
 {
     mRenderPassCleanStart = true;
 
+    // If any of the render targets need to load their multisample textures, we should do the same for depth/stencil.
+    bool forceDepthStencilMultisampleLoad = false;
+
     // Compute loadOp based on previous storeOp and reset storeOp flags:
     for (mtl::RenderPassColorAttachmentDesc &colorAttachment : mRenderPassDesc.colorAttachments)
     {
-        setLoadStoreActionOnRenderPassFirstStart(&colorAttachment);
+        forceDepthStencilMultisampleLoad |= colorAttachment.storeAction == MTLStoreActionStoreAndMultisampleResolve;
+        setLoadStoreActionOnRenderPassFirstStart(&colorAttachment, false);
     }
     // Depth load/store
-    setLoadStoreActionOnRenderPassFirstStart(&mRenderPassDesc.depthAttachment);
+    setLoadStoreActionOnRenderPassFirstStart(&mRenderPassDesc.depthAttachment, forceDepthStencilMultisampleLoad);
 
     // Stencil load/store
-    setLoadStoreActionOnRenderPassFirstStart(&mRenderPassDesc.stencilAttachment);
+    setLoadStoreActionOnRenderPassFirstStart(&mRenderPassDesc.stencilAttachment, forceDepthStencilMultisampleLoad);
 }
 
 void FramebufferMtl::onFrameEnd(const gl::Context *context)

Modified: trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderBufferMtl.mm (275616 => 275617)


--- trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderBufferMtl.mm	2021-04-07 18:23:36 UTC (rev 275616)
+++ trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/RenderBufferMtl.mm	2021-04-07 19:00:32 UTC (rev 275617)
@@ -74,7 +74,7 @@
 
     if ((mTexture == nullptr || !mTexture->valid()) && (width != 0 && height != 0))
     {
-        if (actualSamples == 1 || (mFormat.hasDepthAndStencilBits() && mFormat.getCaps().resolve))
+        if (actualSamples == 1 || (mFormat.getCaps().resolve))
         {
             ANGLE_TRY(mtl::Texture::Make2DTexture(contextMtl, mFormat, static_cast<uint32_t>(width),
                                                   static_cast<uint32_t>(height), 1,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to