Matteo Bruni : wined3d: Regenerate FFP replacement VS on changes to the normal attribute in the vertex declaration.

Alexandre Julliard julliard at wine.codeweavers.com
Sun Jan 3 14:24:15 CST 2016


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

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Mon Dec 14 23:37:53 2015 +0100

wined3d: Regenerate FFP replacement VS on changes to the normal attribute in the vertex declaration.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/glsl_shader.c     | 5 ++++-
 dlls/wined3d/wined3d_private.h | 5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 6fa9521..973b4a0 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8068,6 +8068,7 @@ static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
         const struct wined3d_state *state, DWORD state_id)
 {
     const struct wined3d_gl_info *gl_info = context->gl_info;
+    BOOL normal = !!(context->stream_info.use_map & (1u << WINED3D_FFP_NORMAL));
     BOOL transformed = context->stream_info.position_transformed;
     BOOL wasrhw = context->last_was_rhw;
     unsigned int i;
@@ -8093,7 +8094,8 @@ static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
         /* Because of settings->texcoords, we have to regenerate the vertex
          * shader on a vdecl change if there aren't enough varyings to just
          * always output all the texture coordinates. */
-        if (gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(gl_info))
+        if (gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(gl_info)
+                || normal != context->last_was_normal)
             context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
 
         if (use_ps(state)
@@ -8112,6 +8114,7 @@ static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
     }
 
     context->last_was_vshader = use_vs(state);
+    context->last_was_normal = normal;
 }
 
 static void glsl_vertex_pipe_vs(struct wined3d_context *context,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 53ef63e..70857c9 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1175,6 +1175,7 @@ struct wined3d_context
     DWORD last_was_rhw : 1;             /* true iff last draw_primitive was in xyzrhw mode */
     DWORD last_was_pshader : 1;
     DWORD last_was_vshader : 1;
+    DWORD last_was_normal : 1;
     DWORD namedArraysLoaded : 1;
     DWORD numberedArraysLoaded : 1;
     DWORD last_was_blit : 1;
@@ -1185,17 +1186,17 @@ struct wined3d_context
     DWORD current : 1;
     DWORD destroyed : 1;
     DWORD valid : 1;
-    DWORD use_immediate_mode_draw : 1;
     DWORD texShaderBumpMap : 8;         /* MAX_TEXTURES, 8 */
     DWORD lastWasPow2Texture : 8;       /* MAX_TEXTURES, 8 */
     DWORD fixed_function_usage_map : 8; /* MAX_TEXTURES, 8 */
     DWORD lowest_disabled_stage : 4;    /* Max MAX_TEXTURES, 8 */
+    DWORD use_immediate_mode_draw : 1;
     DWORD rebind_fbo : 1;
     DWORD needs_set : 1;
     DWORD hdc_is_private : 1;
     DWORD hdc_has_format : 1;           /* only meaningful if hdc_is_private */
     DWORD update_shader_resource_bindings : 1;
-    DWORD padding : 15;
+    DWORD padding : 14;
     DWORD shader_update_mask;
     DWORD constant_update_mask;
     DWORD                   numbered_array_mask;




More information about the wine-cvs mailing list