diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2020-12-11 23:31:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-12 10:31:39 +1100 |
| commit | 06057a99a653b83389447a9c56d926c463317b47 (patch) | |
| tree | cd3b7e8700910cc539e78b22746ba01413d9fdba /Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs | |
| parent | 8a6607540ea8933ef9f1f0ff40d910d5bfc3b600 (diff) | |
End empty gl queries before returning them to the pool. (#1806)
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs')
| -rw-r--r-- | Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs b/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs index b4c5259c..a87655be 100644 --- a/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs +++ b/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs @@ -44,14 +44,17 @@ namespace Ryujinx.Graphics.OpenGL.Queries GL.BeginQuery(_type, Query); } - public unsafe void End() + public unsafe void End(bool withResult) { GL.EndQuery(_type); - GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); + if (withResult) + { + GL.BindBuffer(BufferTarget.QueryBuffer, _buffer); - Marshal.WriteInt64(_bufferMap, -1L); - GL.GetQueryObject(Query, GetQueryObjectParam.QueryResult, (long*)0); + Marshal.WriteInt64(_bufferMap, -1L); + GL.GetQueryObject(Query, GetQueryObjectParam.QueryResult, (long*)0); + } } public bool TryGetResult(out long result) |
