Henri Verbeet : wined3d: Explicitly pass data and gl_info to shader_deselect_depth_blt().

Alexandre Julliard julliard at winehq.org
Tue Nov 30 11:01:07 CST 2010


Module: wine
Branch: master
Commit: 7363b0e98a1d6eb79c188b8b453c71d0d151fb16
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7363b0e98a1d6eb79c188b8b453c71d0d151fb16

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Nov 29 23:08:40 2010 +0100

wined3d: Explicitly pass data and gl_info to shader_deselect_depth_blt().

---

 dlls/wined3d/arb_program_shader.c |   19 +++++++++++--------
 dlls/wined3d/glsl_shader.c        |    7 +++----
 dlls/wined3d/shader.c             |    2 +-
 dlls/wined3d/surface.c            |    2 +-
 dlls/wined3d/wined3d_private.h    |    2 +-
 5 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index e1bd3aa..32dbaa3 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -4644,17 +4644,18 @@ static void shader_arb_select_depth_blt(void *shader_priv, const struct wined3d_
 }
 
 /* GL locking is done by the caller */
-static void shader_arb_deselect_depth_blt(IWineD3DDevice *iface) {
-    IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-    struct shader_arb_priv *priv = This->shader_priv;
-    const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
+static void shader_arb_deselect_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info)
+{
+    struct shader_arb_priv *priv = shader_priv;
 
     if (priv->current_vprogram_id) {
         GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, priv->current_vprogram_id));
         checkGLcall("glBindProgramARB(GL_VERTEX_PROGRAM_ARB, vertexShader->prgId);");
 
-        TRACE("(%p) : Bound vertex program %u and enabled GL_VERTEX_PROGRAM_ARB\n", This, priv->current_vprogram_id);
-    } else {
+        TRACE("Bound vertex program %u and enabled GL_VERTEX_PROGRAM_ARB.\n", priv->current_vprogram_id);
+    }
+    else
+    {
         glDisable(GL_VERTEX_PROGRAM_ARB);
         checkGLcall("glDisable(GL_VERTEX_PROGRAM_ARB)");
     }
@@ -4663,8 +4664,10 @@ static void shader_arb_deselect_depth_blt(IWineD3DDevice *iface) {
         GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, priv->current_fprogram_id));
         checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, pixelShader->prgId);");
 
-        TRACE("(%p) : Bound fragment program %u and enabled GL_FRAGMENT_PROGRAM_ARB\n", This, priv->current_fprogram_id);
-    } else if(!priv->use_arbfp_fixed_func) {
+        TRACE("Bound fragment program %u and enabled GL_FRAGMENT_PROGRAM_ARB.\n", priv->current_fprogram_id);
+    }
+    else if(!priv->use_arbfp_fixed_func)
+    {
         glDisable(GL_FRAGMENT_PROGRAM_ARB);
         checkGLcall("glDisable(GL_FRAGMENT_PROGRAM_ARB)");
     }
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 3a609e1..992b6bb 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -4651,10 +4651,9 @@ static void shader_glsl_select_depth_blt(void *shader_priv, const struct wined3d
 }
 
 /* GL locking is done by the caller */
-static void shader_glsl_deselect_depth_blt(IWineD3DDevice *iface) {
-    IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
-    const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
-    struct shader_glsl_priv *priv = This->shader_priv;
+static void shader_glsl_deselect_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info)
+{
+    struct shader_glsl_priv *priv = shader_priv;
     GLhandleARB program_id;
 
     program_id = priv->glsl_program ? priv->glsl_program->programId : 0;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 8f4a72d..ed37fe1 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -1512,7 +1512,7 @@ static void shader_none_handle_instruction(const struct wined3d_shader_instructi
 static void shader_none_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS) {}
 static void shader_none_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info,
         enum tex_types tex_type, const SIZE *ds_mask_size) {}
-static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {}
+static void shader_none_deselect_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info) {}
 static void shader_none_update_float_vertex_constants(IWineD3DDevice *iface, UINT start, UINT count) {}
 static void shader_none_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count) {}
 static void shader_none_load_constants(const struct wined3d_context *context, char usePS, char useVS) {}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index f6b1a10..c54f6ae 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4121,7 +4121,7 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, const struct wined3d_gl
 
     glPopAttrib();
 
-    device->shader_backend->shader_deselect_depth_blt((IWineD3DDevice *)device);
+    device->shader_backend->shader_deselect_depth_blt(device->shader_priv, gl_info);
 }
 
 void surface_modify_ds_location(IWineD3DSurfaceImpl *surface,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d264dce..9c9a952 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -746,7 +746,7 @@ typedef struct {
     void (*shader_select)(const struct wined3d_context *context, BOOL usePS, BOOL useVS);
     void (*shader_select_depth_blt)(void *shader_priv, const struct wined3d_gl_info *gl_info,
             enum tex_types tex_type, const SIZE *ds_mask_size);
-    void (*shader_deselect_depth_blt)(IWineD3DDevice *iface);
+    void (*shader_deselect_depth_blt)(void *shader_priv, const struct wined3d_gl_info *gl_info);
     void (*shader_update_float_vertex_constants)(IWineD3DDevice *iface, UINT start, UINT count);
     void (*shader_update_float_pixel_constants)(IWineD3DDevice *iface, UINT start, UINT count);
     void (*shader_load_constants)(const struct wined3d_context *context, char usePS, char useVS);




More information about the wine-cvs mailing list