Add max retries to BufferedQuery regardless of the presence of wakeSignal, fixed freezing at character selection screen of Super Mario Party Jamboree

This commit is contained in:
Martin Bai
2025-12-25 13:47:27 +00:00
parent f585b36263
commit 48adca40f5

View File

@@ -145,28 +145,13 @@ namespace Ryujinx.Graphics.Vulkan.Queries
{
long data = _defaultValue;
if (wakeSignal == null)
int iterations = 0;
while (WaitingForValue(data) && iterations++ < MaxQueryRetries)
{
while (WaitingForValue(data))
data = Marshal.ReadInt64(_bufferMap);
if (wakeSignal != null && WaitingForValue(data))
{
data = Marshal.ReadInt64(_bufferMap);
}
}
else
{
int iterations = 0;
while (WaitingForValue(data) && iterations++ < MaxQueryRetries)
{
data = Marshal.ReadInt64(_bufferMap);
if (WaitingForValue(data))
{
wakeSignal.WaitOne(1);
}
}
if (iterations >= MaxQueryRetries)
{
Logger.Error?.Print(LogClass.Gpu, $"Error: Query result {_type} timed out. Took more than {MaxQueryRetries} tries.");
wakeSignal.WaitOne(0);
}
}