On Sun, Mar 12, 2006 at 05:44:57PM +0100, Leon Freitag wrote:
The patch http://source.winehq.org/git/?p=wine.git;a=commit;h=13268261bbe0d4013937a6a9... has introduced an annoying performance regression which affected all opengl games. (see http://bugs.winehq.org/show_bug.cgi?id=4499).
Does this help?
Huw.
On Sun, Mar 12, 2006 at 05:44:57PM +0100, Leon Freitag wrote:
The patch http://source.winehq.org/git/?p=wine.git;a=commit;h=13268261bbe0d4013937a 6a9804fbda378244512 has introduced an annoying performance regression which affected all opengl games. (see http://bugs.winehq.org/show_bug.cgi?id=4499).
Does this help?
Huw.
It is indeed a bit faster, however the performance is still far from the old value. I don't see any other way to speed this up the way it's being synced now, the question is however, whether the apps really _should_ modify the bitmap on windows too (don't know whether they would try to draw controls onto the window and then it would be overdrawn by the opengl image; application like Steam are trying to achieve similar, but they seemed to work well before)
Leon
On Tue, 14 Mar 2006 17:18:21 +0100, Leon Freitag wrote:
I don't see any other way to speed this up the way it's being synced now, the question is however, whether the apps really _should_ modify the bitmap on windows too (don't know whether they would try to draw controls onto the window and then it would be overdrawn by the opengl image; application like Steam are trying to achieve similar, but they seemed to work well before)
Does this very rough&ready patch work any better?
--- wgl.c~ 2006-02-11 01:58:59.000000000 +0000 +++ wgl.c 2006-02-16 19:11:33.000000000 +0000 @@ -77,11 +77,14 @@ XVisualInfo *vis; GLXFBConfig fb_conf; GLXContext ctx; + BOOL needs_escape; struct wine_glcontext *next; struct wine_glcontext *prev; } Wine_GLContext; static Wine_GLContext *context_list;
+Wine_GLContext __thread *curctx = NULL; + static inline Wine_GLContext *get_context_from_GLXContext(GLXContext ctx) { Wine_GLContext *ret; @@ -91,18 +94,14 @@
void enter_gl(void) { - GLXContext gl_ctx; - Wine_GLContext *ctx; enum x11drv_escape_codes escape = X11DRV_SYNC_PIXMAP;
- wine_tsx11_lock_ptr(); - gl_ctx = glXGetCurrentContext(); - if(!gl_ctx) return; - ctx = get_context_from_GLXContext(gl_ctx); - wine_tsx11_unlock_ptr(); /* unlock before calling GDI apis */ - - if(ctx && GetObjectType(ctx->hdc) == OBJ_MEMDC) - ExtEscape(ctx->hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape, 0, NULL); + if (curctx && curctx->needs_escape) + { + ERR("foo\n"); + ExtEscape(curctx->hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape, 0, NULL); + } +
wine_tsx11_lock_ptr(); return; @@ -536,6 +535,7 @@ ENTER_GL(); if (hglrc == NULL) { ret = glXMakeCurrent(default_display, None, NULL); + curctx = NULL; } else { Wine_GLContext *ctx = (Wine_GLContext *) hglrc; Drawable drawable = get_drawable( hdc ); @@ -566,8 +566,12 @@ } TRACE(" make current for dis %p, drawable %p, ctx %p\n", ctx->display, (void*) drawable, ctx->ctx); ret = glXMakeCurrent(ctx->display, drawable, ctx->ctx); + curctx = ctx; if(ret && type == OBJ_MEMDC) + { + curctx->needs_escape = TRUE; glDrawBuffer(GL_FRONT_LEFT); + } } LEAVE_GL(); TRACE(" returning %s\n", (ret ? "True" : "False"));
On Wed, Mar 15, 2006 at 12:21:56AM +0000, Mike Hearn wrote:
On Tue, 14 Mar 2006 17:18:21 +0100, Leon Freitag wrote:
I don't see any other way to speed this up the way it's being synced now, the question is however, whether the apps really _should_ modify the bitmap on windows too (don't know whether they would try to draw controls onto the window and then it would be overdrawn by the opengl image; application like Steam are trying to achieve similar, but they seemed to work well before)
Does this very rough&ready patch work any better?
I'm sure it's much faster, problem is it doesn't work. How do we know if the app has fiddled with the dib section bits?
Huw.
On Wed, Mar 15, 2006 at 01:52:19PM +0000, Huw D M Davies wrote:
On Wed, Mar 15, 2006 at 12:21:56AM +0000, Mike Hearn wrote:
Does this very rough&ready patch work any better?
I'm sure it's much faster, problem is it doesn't work. How do we know if the app has fiddled with the dib section bits?
Sorry, maybe I should read the patch properly before commenting :-) I assumed that you were setting need_escape to FALSE after sending the escape, but you're not. Indeed it would be interesting to know if this helped.
Huw.
On Wed, 2006-03-15 at 14:01 +0000, Huw D M Davies wrote:
Sorry, maybe I should read the patch properly before commenting :-) I assumed that you were setting need_escape to FALSE after sending the escape, but you're not. Indeed it would be interesting to know if this helped.
Heh, you had me a bit worried for a second there! Indeed I do not know what the original patch does or why it's needed, but the slowdown just seems related to looking up the Wine_GLContext and testing it.
If this patch improves performance I'll fix it to use Win32 TLS instead of ELF TLS, it'll be interesting to see if that changes makes a difference too.