mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-24 09:44:15 +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:
parent
fba8651213
commit
75ec30c962
2 changed files with 14 additions and 1 deletions
|
@ -43,7 +43,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
|||
IsAbandoned = false;
|
||||
OverrideMaxBufferCount = 0;
|
||||
DequeueBufferCannotBlock = false;
|
||||
UseAsyncBuffer = false;
|
||||
UseAsyncBuffer = true;
|
||||
DefaultWidth = 1;
|
||||
DefaultHeight = 1;
|
||||
DefaultMaxBufferCount = 2;
|
||||
|
|
|
@ -604,6 +604,19 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
|||
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;
|
||||
|
||||
if (!graphicBuffer.IsNull)
|
||||
|
|
Loading…
Reference in a new issue