Skip to content

Conversation

@dzaima
Copy link
Contributor

@dzaima dzaima commented Jan 10, 2026

From what I can tell, fully reinitializing DirectContext is generally undesirable outside of extraordinary situations, and indeed the Metal and D3D12 backends do not do so. Doing that also kills all offscreen Surfaces, forcing unnecessarily discarding & recreating them.

Marking this PR as a draft for now as I don't particularly know how sane the _directContext.resetGLAll(); is (without it there are some graphical glitches), but it does work for the dashboard example and my programs on linux, and allows for me to preserve Surfaces across resizing; will report tomorrow on Windows, don't have macos to test on.

(this whole thing was brought on by me using "is current surface equal to previous surface" as a test for whether I should recreate my offscreen surfaces, which I needed to do for Linux/GL, but the D3D12 backend creates a new surface on every frame not just resizes, making my programs unnecessarily-slow from recreating & redrawing everything on every frame)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant