[PATCH 3/5] wined3d: Pass a wined3d_context_gl structure to create_dummy_textures().

Henri Verbeet hverbeet at codeweavers.com
Tue Jun 4 06:01:52 CDT 2019


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/device.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 751676b75ac..fe7d0e9701a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -672,11 +672,12 @@ out:
 }
 
 /* Context activation is done by the caller. */
-static void create_dummy_textures(struct wined3d_device *device, struct wined3d_context *context)
+static void wined3d_device_gl_create_dummy_textures(struct wined3d_device_gl *device_gl,
+        struct wined3d_context_gl *context_gl)
 {
-    struct wined3d_dummy_textures *textures = &wined3d_device_gl(device)->dummy_textures;
-    const struct wined3d_d3d_info *d3d_info = context->d3d_info;
-    const struct wined3d_gl_info *gl_info = context->gl_info;
+    struct wined3d_dummy_textures *textures = &device_gl->dummy_textures;
+    const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
+    const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
     unsigned int i;
     DWORD color;
 
@@ -689,7 +690,7 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
      * OpenGL will only allow that when a valid texture is bound.
      * We emulate this by creating dummy textures and binding them
      * to each texture stage when the currently set D3D texture is NULL. */
-    context_active_texture(context, gl_info, 0);
+    context_active_texture(&context_gl->c, gl_info, 0);
 
     gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_1d);
     TRACE("Dummy 1D texture given name %u.\n", textures->tex_1d);
@@ -802,7 +803,7 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_
 
     checkGLcall("create dummy textures");
 
-    context_bind_dummy_textures(context);
+    context_bind_dummy_textures(&context_gl->c);
 }
 
 /* Context activation is done by the caller. */
@@ -1081,6 +1082,7 @@ void wined3d_device_delete_opengl_contexts_cs(void *object)
 void wined3d_device_create_primary_opengl_context_cs(void *object)
 {
     struct wined3d_device *device = object;
+    struct wined3d_context_gl *context_gl;
     struct wined3d_swapchain *swapchain;
     struct wined3d_context *context;
     struct wined3d_texture *target;
@@ -1108,7 +1110,8 @@ void wined3d_device_create_primary_opengl_context_cs(void *object)
     swapchain = device->swapchains[0];
     target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer;
     context = context_acquire(device, target, 0);
-    create_dummy_textures(device, context);
+    context_gl = wined3d_context_gl(context);
+    wined3d_device_gl_create_dummy_textures(wined3d_device_gl(device), context_gl);
     create_default_samplers(device, context);
     context_release(context);
 }
-- 
2.11.0




More information about the wine-devel mailing list