[PATCH 0/2] MR9726: wined3d: Do not set "context_gl->needs_set" in wined3d_context_gl_release().
From: Henri Verbeet <hverbeet(a)locutus.nl> Commit ce44dd0ba41b88f6b8eb626863c3358b75aca66c got rid of wined3d_context_gl_restore_pixel_format(), but seemingly inverted the condition under which wined3d_context_gl_release() set the "needs_set" flag. Previously the flag was set when wined3d_context_gl_restore_pixel_format() changed the pixel format, and now it's set when it doesn't. I.e., always. Setting the "needs_set" flag causes wined3d_context_gl_activate() to call wined3d_context_gl_set_gl_context(), which sets the pixel format and makes the GL context current. These are expensive operations. This commit improves performance in the rthdribl demo from a fairly disappointing 1-2 fps to a more reasonable 70-80 fps on my Intel Skylake setup. On my AMD gfx1200 setup the difference is less dramatic but still quite significant, going from about 250 fps to about 350 fps. It's perhaps worth pointing out that after this commit things are still some way off from what they were on Wine 10.0: 150-160 fps on the Intel setup, and about 450 fps on the AMD setup. --- dlls/wined3d/context_gl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 729f4e784bb..6c1b169f4f4 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -1591,8 +1591,6 @@ void wined3d_context_gl_release(struct wined3d_context_gl *context_gl) if (!--context_gl->level) { - context_gl->needs_set = 1; - if (context_gl->restore_ctx) { TRACE("Restoring GL context %p on device context %p.\n", context_gl->restore_ctx, context_gl->restore_dc); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9726
From: Henri Verbeet <hverbeet(a)locutus.nl> Its usage was removed in commit ce44dd0ba41b88f6b8eb626863c3358b75aca66c. --- dlls/wined3d/wined3d_gl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 25174caaf8e..2c22c0a9c3c 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -646,7 +646,6 @@ struct wined3d_context_gl unsigned int level; HGLRC restore_ctx; HDC restore_dc; - int restore_pf; HGLRC gl_ctx; HDC dc; int pixel_format; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9726
participants (2)
-
Henri Verbeet -
Henri Verbeet (@hverbeet)