Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix draw thread unnecessarily marking GL context as current #5689

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Mar 20, 2023

I'll preface this by saying this only affects Veldrid/OpenGL, so this doesn't need immediate attention at all and can be left for another release if preferred.

MakeCurrent calls are supposed to happen internally within the renderer whenever it's expecting to execute GL commands. In Veldrid, all GL commands are executed in a separate thread, therefore calling MakeCurrent here is unnecessary and will fail due to being acquired in the Veldrid thread.

I've kept the ClearCurrent call though since I'm not entirely sure of a better place for it that exists on GLRenderer, and I'm slightly skeptical of doing it in FinishFrame.

Copy link
Member

@Susko3 Susko3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested to work fine on Veldrid/OpenGL and WindowsGL/OpenGL, on both single- and multithreaded. And on Android/OpenGL for good measure.

@smoogipoo smoogipoo merged commit 1ff6694 into ppy:master Mar 21, 2023
@frenzibyte frenzibyte deleted the fix-veldrid-gl-make-current branch March 21, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Various wglMakeCurrent() errors are spammed to log when using Veldrid / OpenGL
3 participants