Module: wine
Branch: master
Commit: f75dadfeb71f1bb7254e38810aec21d87b4b57e6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f75dadfeb71f1bb7254e38810…
Author: Stefan Doesinger <stefan(a)codeweavers.com>
Date: Thu May 28 16:33:36 2009 +0200
d3d9: Accept an alternative oFog->ps_3_0 handling.
---
dlls/d3d9/tests/visual.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 07a3531..fff1f88 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -5594,12 +5594,25 @@ static void vshader_version_varying_test(IDirect3DDevice9 *device) {
color = getPixelColor(device, 160, 120);
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x1a, 0x34, 0x67), 1),
"vs_3_0 returned color 0x%08x, expected 0x00193366\n", color);
+ /* Accept two ways of oFog handling:
+ *
+ * oFog is supposed to be a scalar. The pixel shader declares a vec4 oFog input and reads all components.
+ * The vertex shader writes oFog without a writemask. There are two ways windows drivers deal with this:
+ *
+ * 1) Keep oFog a scalar, and assign v4 = {oFog, 0, 0, 0}. oFog = 0x33, so the result color is 004d0067.
+ * This happens with software vertex processing and on Intel cards
+ *
+ * 2) Make oFog a vec4, and assign v4 = {oFog.x, oFog.y, oFog.z, oFog.w}. This way the result color is
+ * 0x004d339a. This happens on Nvidia Geforce 6+ cards
+ */
color = getPixelColor(device, 160, 360);
- ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x00, 0x67), 1),
+ ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x00, 0x67), 1) ||
+ color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x33, 0x9a), 1),
"vs_1_1 returned color 0x%08x, expected 0x004c0066\n", color);
color = getPixelColor(device, 480, 360);
- ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x00, 0x67), 1),
- "vs_2_0 returned color 0x%08x, expected 0x004c0066\n", color);
+ ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x00, 0x67), 1) ||
+ color_match(color, D3DCOLOR_ARGB(0x00, 0x4d, 0x33, 0x9a), 1),
+ "vs_2_0 returned color 0x%08x, expected 0x004d0067 or 0x004d33a0\n", color);
/* cleanup */
hr = IDirect3DDevice9_SetPixelShader(device, NULL);