diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 7d63ca300b4..9670d6efdd5 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -817,6 +817,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx) ctx->valid = 1; } + ctx->needs_set = 0; return TRUE; } @@ -1080,6 +1081,7 @@ static void context_enter(struct wined3d_context *context) context->restore_ctx = current_gl; context->restore_dc = wglGetCurrentDC(); context->restore_pf = GetPixelFormat(context->restore_dc); + context->needs_set = 1; } } } @@ -1476,6 +1478,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, ret->win_handle = swapchain->win_handle; ret->hdc = hdc; ret->pixel_format = pixel_format; + ret->needs_set = 1; /* Set up the context defaults */ if (!context_set_current(ret)) @@ -3003,7 +3006,7 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str if (!context_set_current(context)) ERR("Failed to activate the new context.\n"); } - else if (context->restore_ctx) + else if (context->needs_set) { context_set_gl_context(context); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9446bb88664..29a76e262e1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1085,7 +1085,8 @@ struct wined3d_context DWORD fixed_function_usage_map : 8; /* MAX_TEXTURES, 8 */ DWORD lowest_disabled_stage : 4; /* Max MAX_TEXTURES, 8 */ DWORD rebind_fbo : 1; - DWORD padding : 19; + DWORD needs_set : 1; + DWORD padding : 18; DWORD shader_update_mask; DWORD constant_update_mask; DWORD numbered_array_mask;