[video] restored texture cache bound and gated present diagnostics

This commit is contained in:
ParantezTech
2026-07-28 16:12:51 +03:00
parent 6b09f1dd22
commit c306f01630
@@ -8459,15 +8459,13 @@ internal static unsafe class VulkanVideoPresenter
/// </summary> /// </summary>
private void DrainGuestImageCpuSync() private void DrainGuestImageCpuSync()
{ {
if (!SharpEmu.HLE.GuestImageWriteTracker.Enabled) var syncEnabled = SharpEmu.HLE.GuestImageWriteTracker.Enabled;
{
return;
}
_ = Interlocked.Exchange(ref _cpuWrittenGuestImageSyncRequested, 0);
HashSet<ulong>? dirtyAddresses = null; HashSet<ulong>? dirtyAddresses = null;
List<(ulong Address, uint Width, uint Height, ulong ByteCount)>? extents = null; List<(ulong Address, uint Width, uint Height, ulong ByteCount)>? extents = null;
if (syncEnabled)
{
_ = Interlocked.Exchange(ref _cpuWrittenGuestImageSyncRequested, 0);
lock (_gate) lock (_gate)
{ {
if (_guestImageExtents.Count > 0) if (_guestImageExtents.Count > 0)
@@ -8536,6 +8534,8 @@ internal static unsafe class VulkanVideoPresenter
} }
} }
}
if (_textureCache.Count == 0) if (_textureCache.Count == 0)
{ {
if (dirtyAddresses is not null) if (dirtyAddresses is not null)
@@ -14508,27 +14508,26 @@ internal static unsafe class VulkanVideoPresenter
if (!tookPresentation) if (!tookPresentation)
{ {
// Upstream also replays the last host splash here after an
// embedded-surface resize. That path is gone with the SDL
// window: there is no host surface to resize around, and the
// swapchain recreate above already covers SDL's own resize.
//
// A render-loop tick with no newer flip is normal. Warn only when // A render-loop tick with no newer flip is normal. Warn only when
// an actual queued presentation is waiting on unfinished guest work. // an actual queued presentation is waiting on unfinished guest work.
var hasPendingPresentation = if (SharpEmu.Libs.Diagnostics.LoadProgressDiagnostics.IsActive ||
HasPendingGuestPresentation(_presentedSequence); ShouldTracePresentedGuestImageContentsForDiagnostics())
SharpEmu.Libs.Diagnostics.LoadProgressDiagnostics.TracePresentNotTaken(
_presentedSequence,
hasPendingPresentation);
SharpEmu.Libs.Diagnostics.LoadProgressDiagnostics.TraceGpuWaitSnapshot();
if (ShouldTracePresentedGuestImageContentsForDiagnostics() &&
hasPendingPresentation &&
_presentNotTakenLoggedSequence != _presentedSequence)
{ {
_presentNotTakenLoggedSequence = _presentedSequence; var hasPendingPresentation =
Console.Error.WriteLine( HasPendingGuestPresentation(_presentedSequence);
$"[LOADER][WARN] vk.present_not_taken seq={_presentedSequence} " + SharpEmu.Libs.Diagnostics.LoadProgressDiagnostics.TracePresentNotTaken(
"— presentation submitted but its required guest work isn't complete; nothing shown."); _presentedSequence,
hasPendingPresentation);
SharpEmu.Libs.Diagnostics.LoadProgressDiagnostics.TraceGpuWaitSnapshot();
if (ShouldTracePresentedGuestImageContentsForDiagnostics() &&
hasPendingPresentation &&
_presentNotTakenLoggedSequence != _presentedSequence)
{
_presentNotTakenLoggedSequence = _presentedSequence;
Console.Error.WriteLine(
$"[LOADER][WARN] vk.present_not_taken seq={_presentedSequence} " +
"— presentation submitted but its required guest work isn't complete; nothing shown.");
}
} }
return; return;