Fixes rendering dirt on the wind shield and GL_INVALID_OPERATION errors in "Need For Speed Shift 2".
The test succeeds on Windows with retail Direct3D 9, but fails with debug Direct3D 9 if selected in DirectX SDK control panel: error code is returned from _DrawIndexedPrimitive() and the triangle is not rendered.
Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/d3d9/tests/visual.c | 138 +++++++++++++++++++++++++++++++++++++++ dlls/wined3d/buffer.c | 8 ++- 2 files changed, 144 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f23fb566e6..a3c02199ee 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -26545,6 +26545,143 @@ done: DestroyWindow(window); }
+static void test_draw_mapped_buffer(void) +{ + IDirect3DVertexBuffer9 *vb; + IDirect3DIndexBuffer9 *ib; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + unsigned int i; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; + void *data; + + static const short indices[] = {0, 1, 2}; + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.1f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.1f}, 0xffff0000}, + }; + static const struct + { + D3DPOOL pool; + DWORD usage; + BOOL todo; + } + tests[] = + { + {D3DPOOL_DEFAULT, D3DUSAGE_DYNAMIC, TRUE}, + {D3DPOOL_MANAGED, 0}, + {D3DPOOL_SYSTEMMEM, 0}, + }; + + window = create_window(); + ok(!!window, "Failed to create a window.\n"); + + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0, + D3DFMT_INDEX16, D3DPOOL_DEFAULT, &ib, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), &data, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, indices, sizeof(indices)); + + hr = IDirect3DDevice9_SetIndices(device, ib); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), tests[i].usage, + D3DFVF_XYZ | D3DFVF_DIFFUSE, tests[i].pool, &vb, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), &data, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, quad, sizeof(quad)); + + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad[0])); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); + 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_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 0, ARRAY_SIZE(quad), 0, 1); + ok(hr == D3D_OK, "Got unexpected hr %#x, test %u.\n", hr, i); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = getPixelColor(device, 160, 120); + ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x, test %u.\n", color, i); + color = getPixelColor(device, 480, 360); + ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x, test %u.\n", color, i); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* One more time now when buffer object in wined3d is already created. */ + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), &data, D3DLOCK_DISCARD); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, quad, sizeof(quad)); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); + 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_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 0, ARRAY_SIZE(quad), 0, 1); + ok(hr == D3D_OK, "Got unexpected hr %#x, test %u.\n", hr, i); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = getPixelColor(device, 160, 120); + + todo_wine_if(tests[i].todo) + ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x, test %u.\n", color, i); + + color = getPixelColor(device, 480, 360); + ok(color_match(color, 0x000000ff, 1), "Got unexpected color 0x%08x, test %u.\n", color, i); + + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + IDirect3DVertexBuffer9_Release(vb); + } + + hr = IDirect3DIndexBuffer9_Unlock(ib); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + IDirect3DIndexBuffer9_Release(ib); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -26690,4 +26827,5 @@ START_TEST(visual) test_nrm_instruction(); test_desktop_window(); test_mismatched_sample_types(); + test_draw_mapped_buffer(); } diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 74c40f9f71..e79bd8f187 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -849,11 +849,15 @@ void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *
TRACE("buffer %p.\n", buffer);
- if (buffer->resource.map_count) + if (buffer->resource.map_count && buffer->map_ptr) { - WARN("Buffer is mapped, skipping preload.\n"); + FIXME("Buffer is mapped through buffer object, not loading.\n"); return; } + else if (buffer->resource.map_count) + { + WARN("Loading mapped buffer.\n"); + }
buffer_mark_used(buffer);
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=56698
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:11972: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25211: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25211: 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:11972: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25211: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25211: 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:11972: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25211: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25211: 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:11972: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25211: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25211: 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:11972: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25211: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25211: 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:11972: Test failed: Got unexpected color 0x0000ff00 (case 0, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 1, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 2, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 3, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 4, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 5, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 6, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 7, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 8, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x00ff0000 (case 9, 3, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 10, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 11, 7, size 0). visual.c:11972: Test failed: Got unexpected color 0x0000ff00 (case 12, 7, size 0). visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 0, location 3x2. visual.c:20801: Test failed: Expected color 0x00000000, got 0x000000ff, format D3DFMT_Q8W8V8U8, test 2, location 3x2. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 80. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 80. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 80. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 77. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 77. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 77. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 75. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 75. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 75. visual.c:22064: Test failed: Got unexpected color 00ffffff at x=64, format 1515474505. visual.c:22071: Test failed: Got unexpected color 000000ff at x=194, format 1515474505. visual.c:22081: Test failed: Got unexpected color 00000000 at x=446, format 1515474505. visual.c:25211: Test failed: Expected unsynchronised map for flags 0x1000. visual.c:25211: Test failed: Expected unsynchronised map for flags 0x3000.
On Fri, 20 Sep 2019 at 21:06, Paul Gofman gofmanp@gmail.com wrote:
todo_wine_if(tests[i].todo)
ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x, test %u.\n", color, i);
This fails here:
visual.c:26243: Test succeeded inside todo block: Got unexpected color 0x00ff0000, test 0.
That probably means that some GL drivers allow drawing from mapped buffers. My Nvidia does not, this is from the test of the concern:
0009:err:d3d:wined3d_debug_callback 0x1ce7a0: "GL_INVALID_OPERATION error generated. Buffer is mapped.".
Do you think it is ok then to just drop the unstable test (that second attempt draws)? I am afraid it might be too fragile regardless, the failure that I initially expect here is already relying on hitting the direct map case in wined3d buffer.c, which is likely to change sooner or later.
On 9/23/19 15:50, Henri Verbeet wrote:
On Fri, 20 Sep 2019 at 21:06, Paul Gofman gofmanp@gmail.com wrote:
todo_wine_if(tests[i].todo)
ok(color_match(color, 0x00ff0000, 1), "Got unexpected color 0x%08x, test %u.\n", color, i);
This fails here:
visual.c:26243: Test succeeded inside todo block: Got unexpected
color 0x00ff0000, test 0.
On Mon, 23 Sep 2019 at 16:58, Paul Gofman gofmanp@gmail.com wrote:
That probably means that some GL drivers allow drawing from mapped buffers. My Nvidia does not, this is from the test of the concern:
0009:err:d3d:wined3d_debug_callback 0x1ce7a0: "GL_INVALID_OPERATION error generated. Buffer is mapped.".
Yes, whether this works or not likely depends on the specifics of the driver, and possibly on things like the size of the buffer. For what it's worth, note also that ARB_buffer_storage explicitly adds the ability to draw from persistently mapped buffers.
Do you think it is ok then to just drop the unstable test (that second attempt draws)? I am afraid it might be too fragile regardless, the failure that I initially expect here is already relying on hitting the direct map case in wined3d buffer.c, which is likely to change sooner or later.
Sure. There might be something to be said for keeping the test but ignoring the result only on Wine, but I don't have a strong opinion on the matter.
On 9/23/19 16:43, Henri Verbeet wrote:
it's worth, note also that ARB_buffer_storage explicitly adds the ability to draw from persistently mapped buffers.
Yes, sure. Both my Nvidia and Intel cards on which I tested this have ARB_buffer_storage extension, but none of them allow drawing from buffers mapped without appropriate flag.
Do you think it is ok then to just drop the unstable test (that second attempt draws)? I am afraid it might be too fragile regardless, the failure that I initially expect here is already relying on hitting the direct map case in wined3d buffer.c, which is likely to change sooner or later.
Sure. There might be something to be said for keeping the test but ignoring the result only on Wine, but I don't have a strong opinion on the matter.
I would prefer to keep it then and ignore Wine result for test 0.
On Mon, Sep 23, 2019 at 3:51 PM Paul Gofman gofmanp@gmail.com wrote:
On 9/23/19 16:43, Henri Verbeet wrote:
it's worth, note also that ARB_buffer_storage explicitly adds the ability to draw from persistently mapped buffers.
Yes, sure. Both my Nvidia and Intel cards on which I tested this have ARB_buffer_storage extension, but none of them allow drawing from buffers mapped without appropriate flag.
FWIW that doesn't generate an error on macOS (which doesn't support ARB_buffer_storage); the GL spec is quite clear that it should be an error.