mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-31 23:19:44 +08:00
[video] restored texture cache bound and gated present diagnostics
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user