[PATCH 4/6] wined3d: Swizzle immediate mode D3DCOLOR attributes if the vertex pipe implementation can't do it.
Matteo Bruni
mbruni at codeweavers.com
Fri Jul 29 14:01:51 CDT 2016
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
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
More information about the wine-patches
mailing list