[PATCH 3/5] wined3d: Store the glEnableWINE and glDisableWINE pointers in the wined3d_gl_info structure.

Henri Verbeet hverbeet at codeweavers.com
Wed May 8 08:21:36 CDT 2019


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/adapter_gl.c      | 4 ++--
 dlls/wined3d/context.c         | 2 +-
 dlls/wined3d/gl_compat.c       | 8 ++++----
 dlls/wined3d/state.c           | 4 ++--
 dlls/wined3d/wined3d_gl.h      | 3 ---
 dlls/wined3d/wined3d_private.h | 3 +++
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 1f4ba793ed8..8a9cbede249 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -4653,8 +4653,8 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl,
     }
 #endif
 
-    glEnableWINE = gl_info->gl_ops.gl.p_glEnable;
-    glDisableWINE = gl_info->gl_ops.gl.p_glDisable;
+    gl_info->p_glEnableWINE = gl_info->gl_ops.gl.p_glEnable;
+    gl_info->p_glDisableWINE = gl_info->gl_ops.gl.p_glDisable;
 
     if (!wined3d_caps_gl_ctx_create(&adapter_gl->a, &caps_gl_ctx))
     {
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index eb64f14f480..e52e4bcff53 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2978,7 +2978,7 @@ void context_apply_ffp_blit_state(struct wined3d_context *context, const struct
     /* Other misc states. */
     gl_info->gl_ops.gl.p_glDisable(GL_LIGHTING);
     context_invalidate_state(context, STATE_RENDER(WINED3D_RS_LIGHTING));
-    glDisableWINE(GL_FOG);
+    gl_info->p_glDisableWINE(GL_FOG);
     context_invalidate_state(context, STATE_RENDER(WINED3D_RS_FOGENABLE));
 
     if (gl_info->supported[EXT_SECONDARY_COLOR])
diff --git a/dlls/wined3d/gl_compat.c b/dlls/wined3d/gl_compat.c
index 7e6b5101bc4..a2fb09c39e1 100644
--- a/dlls/wined3d/gl_compat.c
+++ b/dlls/wined3d/gl_compat.c
@@ -437,10 +437,10 @@ void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_
             gl_info->gl_ops.gl.p_glFogf = wine_glFogf;
             old_fogcoord_glFogfv = gl_info->gl_ops.gl.p_glFogfv;
             gl_info->gl_ops.gl.p_glFogfv = wine_glFogfv;
-            old_fogcoord_glEnable = glEnableWINE;
-            glEnableWINE = wine_glEnable;
-            old_fogcoord_glDisable = glDisableWINE;
-            glDisableWINE = wine_glDisable;
+            old_fogcoord_glEnable = gl_info->p_glEnableWINE;
+            gl_info->p_glEnableWINE = wine_glEnable;
+            old_fogcoord_glDisable = gl_info->p_glDisableWINE;
+            gl_info->p_glDisableWINE = wine_glDisable;
 
             old_fogcoord_glVertex4f = gl_info->gl_ops.gl.p_glVertex4f;
             gl_info->gl_ops.gl.p_glVertex4f = wine_glVertex4f;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index f2ae39e565b..1d2ffbbc981 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1125,7 +1125,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st
     if (!state->render_states[WINED3D_RS_FOGENABLE])
     {
         /* No fog? Disable it, and we're done :-) */
-        glDisableWINE(GL_FOG);
+        gl_info->p_glDisableWINE(GL_FOG);
         checkGLcall("glDisable GL_FOG");
         return;
     }
@@ -1262,7 +1262,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st
         }
     }
 
-    glEnableWINE(GL_FOG);
+    gl_info->p_glEnableWINE(GL_FOG);
     checkGLcall("glEnable GL_FOG");
     if (new_source != context->fog_source || fogstart == fogend)
     {
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index 5241b6c41e1..0e5ae5e1721 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -28,9 +28,6 @@
 
 #define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837  /* not in the gl spec */
 
-void (WINE_GLAPI *glDisableWINE)(GLenum cap) DECLSPEC_HIDDEN;
-void (WINE_GLAPI *glEnableWINE)(GLenum cap) DECLSPEC_HIDDEN;
-
 /* OpenGL extensions. */
 enum wined3d_gl_extension
 {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b649a479f71..2b7172a6dc5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2656,6 +2656,9 @@ struct wined3d_gl_info
     HGLRC (WINAPI *p_wglCreateContextAttribsARB)(HDC dc, HGLRC share, const GLint *attribs);
     struct opengl_funcs gl_ops;
     struct wined3d_fbo_ops fbo_ops;
+
+    void (WINE_GLAPI *p_glDisableWINE)(GLenum cap);
+    void (WINE_GLAPI *p_glEnableWINE)(GLenum cap);
 };
 
 /* The driver names reflect the lowest GPU supported
-- 
2.11.0




More information about the wine-devel mailing list