Matteo Bruni : wined3d: Update vertex shader when the swizzle map changes.
Alexandre Julliard
julliard at winehq.org
Wed Jul 20 10:28:52 CDT 2016
Module: wine
Branch: master
Commit: 8d6ea0ea02e8e1cee6cd873486997b646ca75323
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8d6ea0ea02e8e1cee6cd873486997b646ca75323
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Wed Jul 20 00:33:25 2016 +0200
wined3d: Update vertex shader when the swizzle map changes.
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/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;
More information about the wine-cvs
mailing list