[PATCH 2/5] wined3d: Update vertex shader when the swizzle map changes.

Matteo Bruni mbruni at codeweavers.com
Tue Jul 19 17:33:25 CDT 2016


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
This is also probably a regression fix, maybe of commit
38e4cb29e77edae34fba3bce3d25f2cd2f87ead3.

 dlls/wined3d/glsl_shader.c     | 5 ++++-
 dlls/wined3d/state.c           | 5 +++++
 dlls/wined3d/wined3d_private.h | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index ff0fd2b..c239a47 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -8972,9 +8972,12 @@ static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
     /* If the vertex declaration contains a transformed position attribute,
      * the draw uses the fixed function vertex pipeline regardless of any
      * vertex shader set by the application. */
-    if (transformed != wasrhw)
+    if (transformed != wasrhw
+            || context->stream_info.swizzle_map != context->last_swizzle_map)
         context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
 
+    context->last_swizzle_map = context->stream_info.swizzle_map;
+
     if (!use_vs(state))
     {
         if (context->last_was_vshader)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 98e78da..30ea1c7 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4451,6 +4451,11 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
 
     context->last_was_rhw = transformed;
 
+    if (context->stream_info.swizzle_map != context->last_swizzle_map)
+        context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
+
+    context->last_swizzle_map = context->stream_info.swizzle_map;
+
     /* Don't have to apply the matrices when vertex shaders are used. When
      * vshaders are turned off this function will be called again anyway to
      * make sure they're properly set. */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b400994..3c6c869 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1462,6 +1462,7 @@ struct wined3d_context
     DWORD hdc_has_format : 1;           /* only meaningful if hdc_is_private */
     DWORD update_shader_resource_bindings : 1;
     DWORD padding : 14;
+    DWORD last_swizzle_map; /* MAX_ATTRIBS, 16 */
     DWORD shader_update_mask;
     DWORD constant_update_mask;
     DWORD                   numbered_array_mask;
-- 
2.7.3




More information about the wine-patches mailing list