Henri Verbeet : wined3d: Pass a wined3d_device_gl pointer to wined3d_device_create_primary_opengl_context_cs().

Alexandre Julliard julliard at winehq.org
Thu Dec 9 15:34:28 CST 2021


Module: wine
Branch: master
Commit: c22970af57bd804c5659ee51a21eab80bdbc3550
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c22970af57bd804c5659ee51a21eab80bdbc3550

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Dec  8 22:26:20 2021 -0600

wined3d: Pass a wined3d_device_gl pointer to wined3d_device_create_primary_opengl_context_cs().

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/adapter_gl.c      |  2 +-
 dlls/wined3d/device.c          | 10 ++++++----
 dlls/wined3d/wined3d_private.h |  3 ++-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 9864093c999..fc7a8964923 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -4564,7 +4564,7 @@ static HRESULT adapter_gl_init_3d(struct wined3d_device *device)
 {
     TRACE("device %p.\n", device);
 
-    wined3d_cs_init_object(device->cs, wined3d_device_create_primary_opengl_context_cs, device);
+    wined3d_cs_init_object(device->cs, wined3d_device_gl_create_primary_opengl_context_cs, wined3d_device_gl(device));
     wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
     if (!wined3d_swapchain_gl(device->swapchains[0])->context_count)
         return E_FAIL;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c516594c269..067d54d58e3 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -989,17 +989,19 @@ void wined3d_device_delete_opengl_contexts_cs(void *object)
     }
 }
 
-void wined3d_device_create_primary_opengl_context_cs(void *object)
+void wined3d_device_gl_create_primary_opengl_context_cs(void *object)
 {
-    struct wined3d_device *device = object;
+    struct wined3d_device_gl *device_gl = object;
     struct wined3d_context_gl *context_gl;
     struct wined3d_swapchain *swapchain;
     struct wined3d_context *context;
     struct wined3d_texture *target;
+    struct wined3d_device *device;
     HRESULT hr;
 
-    TRACE("device %p.\n", device);
+    TRACE("device %p.\n", device_gl);
 
+    device = &device_gl->d;
     swapchain = device->swapchains[0];
     target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer;
     if (!(context = context_acquire(device, target, 0)))
@@ -1032,7 +1034,7 @@ void wined3d_device_create_primary_opengl_context_cs(void *object)
     wined3d_fbo_blitter_create(&device->blitter, context_gl->gl_info);
     wined3d_raw_blitter_create(&device->blitter, context_gl->gl_info);
 
-    wined3d_device_gl_create_dummy_textures(wined3d_device_gl(device), context_gl);
+    wined3d_device_gl_create_dummy_textures(device_gl, context_gl);
     wined3d_device_create_default_samplers(device, context);
     context_release(context);
 }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 369f69913a8..e814cff5c39 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3920,7 +3920,6 @@ BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *c
 void device_context_remove(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
 void wined3d_device_create_default_samplers(struct wined3d_device *device,
         struct wined3d_context *context) DECLSPEC_HIDDEN;
-void wined3d_device_create_primary_opengl_context_cs(void *object) DECLSPEC_HIDDEN;
 void wined3d_device_delete_opengl_contexts_cs(void *object) DECLSPEC_HIDDEN;
 void wined3d_device_destroy_default_samplers(struct wined3d_device *device) DECLSPEC_HIDDEN;
 HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined3d,
@@ -3964,6 +3963,8 @@ static inline struct wined3d_device_gl *wined3d_device_gl(struct wined3d_device
     return CONTAINING_RECORD(device, struct wined3d_device_gl, d);
 }
 
+void wined3d_device_gl_create_primary_opengl_context_cs(void *object) DECLSPEC_HIDDEN;
+
 struct wined3d_null_resources_vk
 {
     struct wined3d_bo_vk bo;




More information about the wine-cvs mailing list