1/4 doesn't make much sense? Setting the internal pixel format to 0 isn't actually valid until 2/4. But... ``` @@ -1286,7 +1287,10 @@ static BOOL wined3d_context_gl_set_gl_context(struct wined3d_context_gl *context return FALSE; } + if (context_gl->internal_format_set) + GL_EXTCALL(wglSetPixelFormatWINE(context_gl->dc, 0)); wined3d_release_dc(context_gl->window, context_gl->dc); + if (!(context_gl->dc = wined3d_device_gl_get_backup_dc(device_gl))) { wined3d_context_gl_set_current(NULL); ``` We just failed to set the pixel format, so I don't think there's any reason to unset it here. ``` @@ -1342,7 +1348,11 @@ static void wined3d_context_gl_update_window(struct wined3d_context_gl *context_ context_gl, context_gl->window, context_gl->c.swapchain->win_handle); if (context_gl->dc) + { + if (context_gl->internal_format_set) + GL_EXTCALL(wglSetPixelFormatWINE(context_gl->dc, 0)); wined3d_release_dc(context_gl->window, context_gl->dc); + } context_gl->window = context_gl->c.swapchain->win_handle; context_gl->dc_is_private = FALSE; @@ -1542,6 +1552,8 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) else if (wglGetCurrentContext() && !wglMakeCurrent(NULL, NULL)) ERR("Failed to disable GL context.\n"); + if (context_gl->internal_format_set) + GL_EXTCALL(wglSetPixelFormatWINE(context_gl->dc, 0)); wined3d_release_dc(context_gl->window, context_gl->dc); if (!wglDeleteContext(context_gl->gl_ctx)) ``` Before 2/4 this is just illegal, and after 2/4 the pixel format is per-DC, and we're releasing the DCs here, so this should have no effect? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9382#note_121458