1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-30 23:12:02 +00:00

SurfaceFlinger: fix SetPreallocatedBuffer correctness (#1153)

Nintendo sets the buffer count in SetPreallocatedBuffer too.

This fix triple buffering on all games and finally fix SSBU flickering.
This commit is contained in:
Thog 2020-04-25 12:08:50 +02:00 committed by GitHub
parent fba8651213
commit 75ec30c962
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
IsAbandoned = false; IsAbandoned = false;
OverrideMaxBufferCount = 0; OverrideMaxBufferCount = 0;
DequeueBufferCannotBlock = false; DequeueBufferCannotBlock = false;
UseAsyncBuffer = false; UseAsyncBuffer = true;
DefaultWidth = 1; DefaultWidth = 1;
DefaultHeight = 1; DefaultHeight = 1;
DefaultMaxBufferCount = 2; DefaultMaxBufferCount = 2;

View file

@ -604,6 +604,19 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
Core.Slots[slot].GraphicBuffer.Object.Buffer.Usage &= (int)Core.ConsumerUsageBits; Core.Slots[slot].GraphicBuffer.Object.Buffer.Usage &= (int)Core.ConsumerUsageBits;
} }
int bufferCount = 0;
for (int i = 0; i < Core.Slots.Length; i++)
{
if (!Core.Slots[i].GraphicBuffer.IsNull)
{
bufferCount++;
}
}
Core.OverrideMaxBufferCount = bufferCount;
Core.UseAsyncBuffer = false;
bool cleared = false; bool cleared = false;
if (!graphicBuffer.IsNull) if (!graphicBuffer.IsNull)