[PATCH 1/5] wined3d: Get rid of the "target" parameter to context_create().

Henri Verbeet hverbeet at codeweavers.com
Mon May 6 11:46:27 CDT 2019


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/context.c         | 4 ++--
 dlls/wined3d/swapchain.c       | 4 ++--
 dlls/wined3d/wined3d_private.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 7e7ab09b76c..3b1832fe108 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1966,9 +1966,9 @@ static BOOL wined3d_context_init(struct wined3d_context *context, struct wined3d
     return TRUE;
 }
 
-struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
-        struct wined3d_texture *target, const struct wined3d_format *ds_format)
+struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, const struct wined3d_format *ds_format)
 {
+    struct wined3d_texture *target = swapchain->front_buffer;
     struct wined3d_device *device = swapchain->device;
     struct wined3d_context_gl *context_gl;
     struct wined3d_context *context;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 4ac091f6924..7210682c45f 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -739,7 +739,7 @@ static void wined3d_swapchain_cs_init(void *object)
     for (i = 0; i < ARRAY_SIZE(formats); ++i)
     {
         swapchain->ds_format = wined3d_get_format(adapter, formats[i], WINED3D_BIND_DEPTH_STENCIL);
-        if ((swapchain->context[0] = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format)))
+        if ((swapchain->context[0] = context_create(swapchain, swapchain->ds_format)))
             break;
         TRACE("Depth stencil format %s is not supported, trying next format.\n", debug_d3dformat(formats[i]));
     }
@@ -1085,7 +1085,7 @@ static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain
 
     TRACE("Creating a new context for swapchain %p, thread %u.\n", swapchain, GetCurrentThreadId());
 
-    if (!(ctx = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format)))
+    if (!(ctx = context_create(swapchain, swapchain->ds_format)))
     {
         ERR("Failed to create a new context for the swapchain\n");
         return NULL;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e698c792813..02177a96b7f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2196,7 +2196,7 @@ void context_check_fbo_status(const struct wined3d_context *context, GLenum targ
 void context_copy_bo_address(struct wined3d_context *context,
         const struct wined3d_bo_address *dst, GLenum dst_binding,
         const struct wined3d_bo_address *src, GLenum src_binding, size_t size) DECLSPEC_HIDDEN;
-struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_texture *target,
+struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
         const struct wined3d_format *ds_format) DECLSPEC_HIDDEN;
 HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN;
 void wined3d_context_destroy(struct wined3d_context *context) DECLSPEC_HIDDEN;
-- 
2.11.0




More information about the wine-devel mailing list