From 5dab515c7a1d5cdfb39d5485696b938564761cfb Mon Sep 17 00:00:00 2001 From: riperiperi Date: Wed, 27 May 2020 08:51:03 +0100 Subject: [PATCH] Flush GL commands before inevitably waiting for a query result. (#1278) --- Ryujinx.Graphics.OpenGL/Pipeline.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index affb4efc4..ee4ce298b 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -1067,11 +1067,15 @@ namespace Ryujinx.Graphics.OpenGL } } - return false; // The GPU will flush the queries to CPU and evaluate the condition there instead. + // The GPU will flush the queries to CPU and evaluate the condition there instead. + + GL.Flush(); // The thread will be stalled manually flushing the counter, so flush GL commands now. + return false; } public bool TryHostConditionalRendering(ICounterEvent value, ICounterEvent compare, bool isEqual) { + GL.Flush(); // The GPU thread will be stalled manually flushing the counter, so flush GL commands now. return false; // We don't currently have a way to compare two counters for conditional rendering. }