mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-25 18:13:04 +00:00
When batching, don't place barriers between every copy
This commit is contained in:
parent
1a85c9a00b
commit
a46b1bd88c
2 changed files with 9 additions and 4 deletions
|
@ -49,11 +49,15 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
|||
GL.BeginQuery(_type, Query);
|
||||
}
|
||||
|
||||
public unsafe void CopyQueryResult()
|
||||
public unsafe void CopyQueryResult(bool withBarrier)
|
||||
{
|
||||
GL.BindBuffer(BufferTarget.QueryBuffer, _buffer);
|
||||
GL.GetQueryObject(Query, GetQueryObjectParam.QueryResult, (long*)0);
|
||||
GL.MemoryBarrier(MemoryBarrierFlags.QueryBufferBarrierBit | MemoryBarrierFlags.ClientMappedBufferBarrierBit);
|
||||
|
||||
if (withBarrier)
|
||||
{
|
||||
GL.MemoryBarrier(MemoryBarrierFlags.QueryBufferBarrierBit | MemoryBarrierFlags.ClientMappedBufferBarrierBit);
|
||||
}
|
||||
}
|
||||
|
||||
public void End(bool withResult)
|
||||
|
@ -64,7 +68,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
|||
{
|
||||
if (!_parent.QueueCopy(this))
|
||||
{
|
||||
CopyQueryResult();
|
||||
CopyQueryResult(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -66,9 +66,10 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
|||
{
|
||||
if (_queuedCopies.Count > 0)
|
||||
{
|
||||
int i = 0;
|
||||
foreach (BufferedQuery query in _queuedCopies)
|
||||
{
|
||||
query.CopyQueryResult();
|
||||
query.CopyQueryResult(_queuedCopies.Count == ++i);
|
||||
}
|
||||
|
||||
_queuedCopies.Clear();
|
||||
|
|
Loading…
Reference in a new issue