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

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2022-04-27 13:21:55 +02:00 committed by Alexandre Julliard
parent 4aac4bbea6
commit ab72e33641
2 changed files with 12 additions and 6 deletions

View File

@ -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,

View File

@ -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);