Henri Verbeet : wined3d: Use context_acquire() in wined3d_swapchain_cs_init().
Alexandre Julliard
julliard at winehq.org
Thu May 16 16:26:58 CDT 2019
Module: wine
Branch: master
Commit: db201072655946662c041a66ee434c30c245e5b0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=db201072655946662c041a66ee434c30c245e5b0
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu May 16 17:53:00 2019 +0430
wined3d: Use context_acquire() in wined3d_swapchain_cs_init().
Instead of calling context_create() directly.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/context.c | 7 ++++---
dlls/wined3d/swapchain.c | 8 ++++----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 38a4462..7cd16d5 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -4264,7 +4264,8 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device,
{
TRACE("Rendering onscreen.\n");
- context = swapchain_get_context(texture->swapchain);
+ if (!(context = swapchain_get_context(texture->swapchain)))
+ return NULL;
}
else
{
@@ -4274,8 +4275,8 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device,
* context for the primary swapchain. */
if (current_context && current_context->device == device)
context = current_context;
- else
- context = swapchain_get_context(device->swapchains[0]);
+ else if (!(context = swapchain_get_context(device->swapchains[0])))
+ return NULL;
}
context_activate(context, texture, sub_resource_idx);
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index f47c1a4..fbedd74 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -720,20 +720,20 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s
static void wined3d_swapchain_cs_init(void *object)
{
struct wined3d_swapchain *swapchain = object;
+ struct wined3d_context *context;
- if (!(swapchain->context[0] = context_create(swapchain)))
+ if (!(context = context_acquire(swapchain->device, swapchain->front_buffer, 0)))
{
- WARN("Failed to create context.\n");
+ WARN("Failed to acquire context.\n");
return;
}
- swapchain->num_contexts = 1;
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
&& (!swapchain->desc.enable_auto_depth_stencil
|| swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id))
FIXME("Add OpenGL context recreation support.\n");
- context_release(swapchain->context[0]);
+ context_release(context);
}
void swapchain_set_max_frame_latency(struct wined3d_swapchain *swapchain, const struct wined3d_device *device)
More information about the wine-cvs
mailing list