Henri Verbeet : wined3d: Pass the texture type to the shader depth blt function.

Alexandre Julliard julliard at winehq.org
Tue Oct 28 10:01:58 CDT 2008


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

Author: Henri Verbeet <hverbeet at gmail.com>
Date:   Mon Oct 27 18:31:31 2008 +0100

wined3d: Pass the texture type to the shader depth blt function.

---

 dlls/wined3d/arb_program_shader.c |    4 +++-
 dlls/wined3d/baseshader.c         |    2 +-
 dlls/wined3d/glsl_shader.c        |    4 +++-
 dlls/wined3d/surface.c            |    2 +-
 dlls/wined3d/wined3d_private.h    |   21 +++++++++++----------
 5 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 2494ced..2acf5ea 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -1880,11 +1880,13 @@ static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
     }
 }
 
-static void shader_arb_select_depth_blt(IWineD3DDevice *iface) {
+static void shader_arb_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
     struct shader_arb_priv *priv = (struct shader_arb_priv *) This->shader_priv;
     WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
 
+    if (tex_type != tex_2d) FIXME("Unsupported tex_type %#x\n", tex_type);
+
     if (!priv->depth_blt_vprogram_id) priv->depth_blt_vprogram_id = create_arb_blt_vertex_program(gl_info);
     GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, priv->depth_blt_vprogram_id));
     glEnable(GL_VERTEX_PROGRAM_ARB);
diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c
index 877b0ee..03567a1 100644
--- a/dlls/wined3d/baseshader.c
+++ b/dlls/wined3d/baseshader.c
@@ -1092,7 +1092,7 @@ void shader_trace_init(
 
 static const SHADER_HANDLER shader_none_instruction_handler_table[WINED3DSIH_TABLE_SIZE] = {0};
 static void shader_none_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {}
-static void shader_none_select_depth_blt(IWineD3DDevice *iface) {}
+static void shader_none_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) {}
 static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {}
 static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {}
 static void shader_none_cleanup(IWineD3DDevice *iface) {}
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 61a38c5..c1f23c7 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -3454,11 +3454,13 @@ static void shader_glsl_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
     checkGLcall("glUseProgramObjectARB");
 }
 
-static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) {
+static void shader_glsl_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
     WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
     struct shader_glsl_priv *priv = (struct shader_glsl_priv *) This->shader_priv;
 
+    if (tex_type != tex_2d) FIXME("Unsupported tex_type %#x\n", tex_type);
+
     if (!priv->depth_blt_glsl_program_id) {
         GLhandleARB loc;
         priv->depth_blt_glsl_program_id = create_glsl_blt_shader(gl_info);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a44131a..7017d40 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3976,7 +3976,7 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, GLuint texture, GLsizei
     glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding);
     glBindTexture(GL_TEXTURE_2D, texture);
 
-    device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device);
+    device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device, tex_2d);
 
     glBegin(GL_TRIANGLE_STRIP);
     glVertex2f(-1.0f, -1.0f);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 428fedf..1ca1edd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -323,10 +323,20 @@ struct shader_caps {
     DWORD               MaxPixelShader30InstructionSlots;
 };
 
+enum tex_types
+{
+    tex_1d       = 0,
+    tex_2d       = 1,
+    tex_3d       = 2,
+    tex_cube     = 3,
+    tex_rect     = 4,
+    tex_type_count = 5,
+};
+
 typedef struct {
     const SHADER_HANDLER *shader_instruction_handler_table;
     void (*shader_select)(IWineD3DDevice *iface, BOOL usePS, BOOL useVS);
-    void (*shader_select_depth_blt)(IWineD3DDevice *iface);
+    void (*shader_select_depth_blt)(IWineD3DDevice *iface, enum tex_types tex_type);
     void (*shader_deselect_depth_blt)(IWineD3DDevice *iface);
     void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS);
     void (*shader_cleanup)(IWineD3DDevice *iface);
@@ -821,15 +831,6 @@ enum projection_types
     proj_count4  = 2
 };
 
-enum tex_types
-{
-    tex_1d       = 0,
-    tex_2d       = 1,
-    tex_3d       = 2,
-    tex_cube     = 3,
-    tex_rect     = 4
-};
-
 enum dst_arg
 {
     resultreg    = 0,




More information about the wine-cvs mailing list