diff --git a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp index 4fb3a3d3..d74d900f 100644 --- a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp @@ -18879,7 +18879,12 @@ namespace MobileGL::MG_Backend::DirectGLES { // producer), nothing it submitted still samples the image. (void)WaitForCompletion(); } - frame.Tracker.PublishFrame(fence); + // A session that writes images publishes every boundary as a write: an image it rendered + // into must not leave the frame without its generation moving. + if (frame.ImplicitSync) + frame.Tracker.PublishFrameAsWrite(fence); + else + frame.Tracker.PublishFrame(fence); frame.Id = g_readFrameIds.fetch_add(1, std::memory_order_relaxed) + 1; } diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/WireSharedImage.inc b/MobileGL/MG_Backend/DirectVulkan/Renderer/WireSharedImage.inc index 43df6dfb..892a5b0a 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/WireSharedImage.inc +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/WireSharedImage.inc @@ -637,7 +637,11 @@ } // No fence (no export on this device): the frame's reads go unpublished - the file // comment says why that is the choice. - m_sharedImageReads.PublishFrame(fence); + // A session that writes images publishes every boundary as a write (PublishSharedImageAccesses). + if (m_sharedImageImplicitSync) + m_sharedImageReads.PublishFrameAsWrite(fence); + else + m_sharedImageReads.PublishFrame(fence); } void VulkanRenderer::AbandonSharedImageReads() {