From 2fa370090c006bbde9b9534223f2fcfec489bcb5 Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Sun, 9 Sep 2018 13:23:24 -0700 Subject: [PATCH] [OpenGL] Stop tracking CommandLists when their reference count reaches 0. --- src/Veldrid/OpenGL/OpenGLGraphicsDevice.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Veldrid/OpenGL/OpenGLGraphicsDevice.cs b/src/Veldrid/OpenGL/OpenGLGraphicsDevice.cs index fcb3bdfa6..1a6a1f9da 100644 --- a/src/Veldrid/OpenGL/OpenGLGraphicsDevice.cs +++ b/src/Veldrid/OpenGL/OpenGLGraphicsDevice.cs @@ -672,7 +672,14 @@ private int DecrementCount(OpenGLCommandList glCommandList) count = -1; } - _submittedCommandListCounts[glCommandList] = count; + if (count == 0) + { + _submittedCommandListCounts.Remove(glCommandList); + } + else + { + _submittedCommandListCounts[glCommandList] = count; + } return count; }