This proves that stencil reference got truncated instead of ANDed with stencil mask.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/d3d9/tests/visual.c | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f2c6ee42dc..c7de570b42 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -11155,6 +11155,59 @@ static void stencil_cull_test(void) color = getPixelColor(device, 480, 60); ok(color == 0x00000080, "CW triangle, twoside TRUE, cull cw, culled, has color 0x%08x, expected 0x00000080\n", color);
+ /* Test for reference truncation */ + /* 1st pass: set stencil */ + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_STENCIL, 0x00ff0000, 0.0, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, 0x1cc); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILMASK, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFUNC, D3DCMP_ALWAYS); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, TRUE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad1, sizeof(float) * 3); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* 2nd pass: draw image */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILPASS, D3DSTENCILOP_KEEP); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, 0xcc); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILMASK, 0xff); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILFUNC, D3DCMP_EQUAL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, painter, sizeof(painter[0])); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = getPixelColor(device, 280, 360); + todo_wine ok(color == 0x000000f0, "has color 0x%08x, expected 0x00000090\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=55681
Your paranoid android.
=== debian10 (32 bit report) ===
d3d9: visual.c:9410: Test failed: Test 0 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 6 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 10 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 11 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 12 shading has color1 000000ff, expected 0000ff00. visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian10 (32 bit French report) ===
d3d9: visual.c:9410: Test failed: Test 0 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 6 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 10 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 11 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 12 shading has color1 000000ff, expected 0000ff00. visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian10 (32 bit Japanese:Japan report) ===
d3d9: visual.c:9410: Test failed: Test 0 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 6 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 10 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 11 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 12 shading has color1 000000ff, expected 0000ff00. visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian10 (32 bit Chinese:China report) ===
d3d9: visual.c:9410: Test failed: Test 0 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 6 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 10 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 11 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 12 shading has color1 000000ff, expected 0000ff00. visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian10 (32 bit WoW report) ===
d3d9: visual.c:9410: Test failed: Test 0 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 6 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 10 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 11 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 12 shading has color1 000000ff, expected 0000ff00. visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian10 (64 bit WoW report) ===
d3d9: visual.c:9410: Test failed: Test 0 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 6 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 10 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 11 shading has color1 000000ff, expected 0000ff00. visual.c:9410: Test failed: Test 12 shading has color1 000000ff, expected 0000ff00. visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11967: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20796: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22059: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22066: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22076: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25206: Test failed: Expected unsynchronised map for flags 0x3000.
Stencil mask is supposed to be used with reference value on comparison according to MSDN [1] (which of course does not guarantee that it is the case on Windows). I've modified your test a bit to show that it is really the case, the modified test succeeds for me on Windows 7, Nvidia or Intet GPU. HP (see attached, to be applied after your patches). But it also succeeds in Wine with your modifications to wined3d (after removing AND with the mask). Which probably means that: - Opengl applies the mask to ref value as it is supposed to ([2]); - ref value is probably not clamped to stencil buffer range for comparison while it looks so in native d3d9; - Stencil mask is ignored when storing ref value to stencil buffer both in opengl and d3d9.
I also tested that Test Drive Unlimited glitch (which was fixed by a9e199e5ad76c0540381f25011d6051ace3e7c0a) does not reappear after your patches.
1. https://docs.microsoft.com/en-us/windows/win32/direct3d9/d3drenderstatetype, description for D3DRS_STENCILMASK. 2. https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilFuncSepar..., description for 'mask' parameter.
On 8/21/19 12:46, Zhiyi Zhang wrote:
This proves that stencil reference got truncated instead of ANDed with stencil mask.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=55693
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/d3d9/tests/visual.c:11159 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d9/tests/visual.c:11159 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/d3d9/tests/visual.c:11159 Task: Patch failed to apply