Fix preload cbs optimization (for real) (#34)

* Mostly fix preload cbs. There seems to be some random flickering...

* fix index buffer usage range

* fix missing preflush submit before present
This commit is contained in:
riperiperi
2024-07-05 09:35:17 +01:00
committed by Evan Husted
parent 0bb0ecb599
commit 8411f69899
2 changed files with 21 additions and 9 deletions

View File

@@ -191,14 +191,14 @@ namespace Ryujinx.Graphics.Metal
}
if (cbs != null &&
_pipeline.RenderPassActive &&
cbs.Value.Encoders.CurrentEncoderType == EncoderType.Render &&
!(_buffer.HasCommandBufferDependency(cbs.Value) &&
_waitable.IsBufferRangeInUse(cbs.Value.CommandBufferIndex, offset, dataSize)))
{
// If the buffer hasn't been used on the command buffer yet, try to preload the data.
// This avoids ending and beginning render passes on each buffer data upload.
cbs = _pipeline.PreloadCbs;
cbs = _pipeline.GetPreloadCommandBuffer();
}
if (allowCbsWait)