aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs')
-rw-r--r--Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs b/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs
index 4cf258eb..a1a5eb27 100644
--- a/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs
+++ b/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs
@@ -18,7 +18,6 @@ namespace Ryujinx.Graphics.Vulkan.Queries
private readonly PipelineFull _pipeline;
private QueryPool _queryPool;
- private bool _isReset;
private readonly BufferHolder _buffer;
private readonly IntPtr _bufferMap;
@@ -27,6 +26,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries
private bool _isSupported;
private long _defaultValue;
+ private int? _resetSequence;
public unsafe BufferedQuery(VulkanRenderer gd, Device device, PipelineFull pipeline, CounterType type, bool result32Bit)
{
@@ -92,16 +92,17 @@ namespace Ryujinx.Graphics.Vulkan.Queries
public void Reset()
{
End(false);
- Begin();
+ Begin(null);
}
- public void Begin()
+ public void Begin(int? resetSequence)
{
if (_isSupported)
{
- _pipeline.BeginQuery(this, _queryPool, !_isReset);
+ bool needsReset = resetSequence == null || _resetSequence == null || resetSequence.Value != _resetSequence.Value;
+ _pipeline.BeginQuery(this, _queryPool, needsReset, _type == CounterType.SamplesPassed && resetSequence != null);
}
- _isReset = false;
+ _resetSequence = null;
}
public unsafe void End(bool withResult)
@@ -162,13 +163,14 @@ namespace Ryujinx.Graphics.Vulkan.Queries
return data;
}
- public void PoolReset(CommandBuffer cmd)
+ public void PoolReset(CommandBuffer cmd, int resetSequence)
{
if (_isSupported)
{
_api.CmdResetQueryPool(cmd, _queryPool, 0, 1);
}
- _isReset = true;
+
+ _resetSequence = resetSequence;
}
public void PoolCopy(CommandBufferScoped cbs)