Commit ab72e336 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Don't use fences on GL context cleanup when they are not supported.

parent 4aac4bbe
......@@ -1393,13 +1393,16 @@ static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
{
/* If we're here because we're switching away from a previously
* destroyed context, acquiring a context in order to submit a fence
* is problematic. (In particular, we'd end up back here again in the
* process of switching to the newly acquired context.) */
* is problematic. In particular, we'd end up back here again in the
* process of switching to the newly acquired context.
*
* If fences aren't supported there should be nothing to wait for
* anyway, so just do nothing in that case. */
if (context_gl->c.destroyed)
{
gl_info->gl_ops.gl.p_glFinish();
}
else
else if (context_gl->c.d3d_info->fences)
{
wined3d_context_gl_submit_command_fence(context_gl);
wined3d_context_gl_wait_command_fence(context_gl,
......
......@@ -1201,9 +1201,12 @@ void wined3d_device_gl_delete_opengl_contexts_cs(void *object)
device->shader_backend->shader_free_private(device, context);
wined3d_device_gl_destroy_dummy_textures(device_gl, context_gl);
wined3d_context_gl_submit_command_fence(context_gl);
wined3d_context_gl_wait_command_fence(context_gl,
wined3d_device_gl(context_gl->c.device)->current_fence_id - 1);
if (context_gl->c.d3d_info->fences)
{
wined3d_context_gl_submit_command_fence(context_gl);
wined3d_context_gl_wait_command_fence(context_gl,
wined3d_device_gl(context_gl->c.device)->current_fence_id - 1);
}
wined3d_allocator_cleanup(&device_gl->allocator);
context_release(context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment