forked from Mirror/Ryujinx
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;
|
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;
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue