From: Matteo Bruni Subject: [PATCH 5/6] wined3d: Prevent double swizzling in non-FFP draws with the ARB backend. Message-Id: <1469818913-6073-5-git-send-email-mbruni@codeweavers.com> Date: Fri, 29 Jul 2016 21:01:52 +0200 In-Reply-To: <1469818913-6073-1-git-send-email-mbruni@codeweavers.com> References: <1469818913-6073-1-git-send-email-mbruni@codeweavers.com> Signed-off-by: Matteo Bruni --- 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