WINED3D: Color fixups for vertex shaders

H. Verbeet hverbeet at gmail.com
Wed Mar 8 17:51:33 CST 2006


Direct3D stores vertex color data in BGRA order, OpenGL stores it in
RGBA order. This causes red and blue to be swapped in d3d applications
when run under wine. This patch fixes this problem for vertex shaders
by enabling the flag that causes red and blue to be swapped in
vshader_program_add_input_param_swizzle, when appropriate.

Changelog:
  - Enable color fixups for vertex shaders
-------------- next part --------------
diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c
index 12960ae..000a1aa 100644
--- a/dlls/wined3d/vertexshader.c
+++ b/dlls/wined3d/vertexshader.c
@@ -969,6 +969,10 @@ inline static void vshader_program_add_p
     strcat(hwLine, tmpReg);
     break;
   case D3DSPR_INPUT:
+    if (reg == This->arrayUsageMap[WINED3DSHADERDECLUSAGE_DIFFUSE]
+        || reg == This->arrayUsageMap[WINED3DSHADERDECLUSAGE_SPECULAR]) {
+        is_color = TRUE;
+    }
     /* if the attributes come in as named dcl's then use a named vertex (called namedVertexN) */
     if (This->namedArrays) {
         sprintf(tmpReg, "namedVertex%lu", reg);



More information about the wine-patches mailing list