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; }