[PATCH 5/6] wined3d: Prevent double swizzling in non-FFP draws with the ARB backend.

Matteo Bruni mbruni at codeweavers.com
Fri Jul 29 14:01:52 CDT 2016


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
This should fix the ARB backend. Somewhat hacky, not sure there is a
better fix short of implementing a replacement vertex pipe for ARB
though...

 dlls/wined3d/context.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index ca06f31..4d6eedd 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3129,6 +3129,15 @@ void context_stream_info_from_declaration(struct wined3d_context *context,
                     && element->format->id == WINED3DFMT_B8G8R8A8_UNORM)
             {
                 stream_info->swizzle_map |= 1u << idx;
+                /* If we're going to use immediate-mode for VS draws with a
+                 * setup which can't apply shader-level swizzles to FFP draws
+                 * we would get double swizzling. Disable the shader-level
+                 * swizzle in that case. */
+                if (!context->d3d_info->ffp_d3dcolor_swizzle
+                        && use_vshader && ((!context->gl_info->supported[ARB_INSTANCED_ARRAYS]
+                        && stream_info->elements[idx].divisor != 0)
+                        || declaration->half_float_conv_needed))
+                    stream_info->swizzle_map &= ~(1u << idx);
             }
             stream_info->use_map |= 1u << idx;
         }
-- 
2.7.3




More information about the wine-patches mailing list