From: Matteo Bruni Subject: [PATCH 4/6] wined3d: Swizzle immediate mode D3DCOLOR attributes if the vertex pipe implementation can't do it. Message-Id: <1469818913-6073-4-git-send-email-mbruni@codeweavers.com> Date: Fri, 29 Jul 2016 21:01:51 +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 --- dlls/wined3d/directx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 19051b0..ffe6280 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -5855,7 +5855,12 @@ static void wined3d_adapter_init_ffp_attrib_ops(struct wined3d_adapter *adapter) ops->generic[WINED3D_FFP_EMIT_FLOAT2] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib2fv; ops->generic[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib3fv; ops->generic[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4fv; - if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA]) + /* If ARB_vertex_array_bgra is supported we always do the swizzling on + * vertex upload (be it via glVertexAttribPointer() or immediate mode like + * this). If the GL functionality is not supported, swizzling will be + * responsibility of the vertex shader / vertex pipe replacement, if it + * can do it. If it can't, we manually swizzle immediate mode uploads. */ + if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA] || !d3d_info->ffp_d3dcolor_swizzle) ops->generic[WINED3D_FFP_EMIT_D3DCOLOR] = generic_d3dcolor; else ops->generic[WINED3D_FFP_EMIT_D3DCOLOR] = -- 2.7.3