[PATCH] winex11: Don't create a temporary context each time X11DRV_wglBindTexImageARB is called.

Matteo Bruni matteo.mystral at gmail.com
Mon Mar 14 21:59:05 CDT 2016


2016-03-12 14:57 GMT+01:00 Miklós Máté <mtmkls at gmail.com>:
> Theoretically wglBindTexImageARB is supposed to be a fast
> render-to-texture method, and creating a new context is anything but fast.
>
> This fixes horrible performance in Star Wars
> Knights of the Old Republic when post-process effects are enabled.
>
> v2: fix context caching, fix destructor, fix comments
> v3: better handling of context delete
>
> Signed-off-by: Miklós Máté <mtmkls at gmail.com>

Thank you for following up after the review comments. Unfortunately I
think there is one more (and hopefully last) bit which still needs
addressing:

> @@ -2301,6 +2314,7 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat
>          SetLastError(ERROR_NO_SYSTEM_RESOURCES);
>          goto create_failed; /* unexpected error */
>      }
> +    list_add_head( &pbuffer_list, &object->entry );
>      TRACE("->(%p)\n", object);
>      return object;

This needs to be done inside the critical section, so please put
EnterCriticalSection() + LeaveCriticalSection() around it. FTR the
wglCreateContext and wglCreateContextAttribsARB implementation
functions indirectly acquire and release the critical section via
get_gl_drawable() / release_gl_drawable().

It looks good to me otherwise.



More information about the wine-devel mailing list