mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-04 22:09:59 +03:00
Metal: Flush with NoWait when hitting renderpass count limits
This flush was added as an optimization to handle a specific use case where many expensive GPU operations (clears and uploads) were queued without being flushed. The GPU would be idle during these periods. WaitUntilScheduled forced CPU/GPU synchronization when it was not needed. We just want to make sure the work is flushed so the GPU can pick it up later, not synchronize with anything external. WaitUntilScheduled is used on iOS still because the Chrome waterfall does not have coverage of iOS performance. Bug: chromium:1466696 Change-Id: Ia8938eddf5be5ce586a91ad759d1563182176dba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4717367 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
committed by
Angle LUCI CQ
parent
4cae3b09ab
commit
84f5295c97
@@ -1828,13 +1828,17 @@ void ContextMtl::flushCommandBufferIfNeeded()
|
||||
{
|
||||
if (mRenderPassesSinceFlush >= mtl::kMaxRenderPassesPerCommandBuffer)
|
||||
{
|
||||
// WaitUntilScheduled here is intended to help the CPU-GPU pipeline and
|
||||
// helps to keep the number of inflight render passes in the system to a
|
||||
// minimum.
|
||||
#if defined(ANGLE_PLATFORM_MACOS)
|
||||
// Ensure that we don't accumulate too many unflushed render passes. Don't wait until they
|
||||
// are submitted, other components handle backpressure so don't create uneccessary CPU/GPU
|
||||
// synchronization.
|
||||
flushCommandBuffer(mtl::NoWait);
|
||||
#else
|
||||
// WaitUntilScheduled is used on iOS to avoid regressing untested devices.
|
||||
flushCommandBuffer(mtl::WaitUntilScheduled);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (mCmdBuffer.needsFlushForDrawCallLimits())
|
||||
else if (mCmdBuffer.needsFlushForDrawCallLimits())
|
||||
{
|
||||
flushCommandBuffer(mtl::NoWait);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user