My Geforce 7 sends R5G6B5 data to the R5G5B5A1 surface without any conversion. r200 and r500 set the alpha bit on the destination. This applies to sysmem->vidmem and vidmem->vidmem blits.
Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/ddraw/tests/ddraw4.c | 7 +++++-- dlls/ddraw/tests/ddraw7.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 7ce33ab4063..b6cb97c3c98 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -16719,7 +16719,7 @@ static void test_surface_format_conversion_alpha(void) const char *name; unsigned int block_size, x_blocks, y_blocks; DWORD support_flag; - BOOL broken_software_blit; + BOOL broken_software_blit, broken_hardware_blit; } formats[] = { @@ -16759,7 +16759,7 @@ static void test_surface_format_conversion_alpha(void) sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, {16}, {0x00007c00}, {0x000003e0}, {0x0000001f}, {0x00008000} }, - "R5G5B5A1", 2, 4, 4, + "R5G5B5A1", 2, 4, 4, 0, FALSE, TRUE, }, { { @@ -16888,6 +16888,9 @@ static void test_surface_format_conversion_alpha(void) if (!is_wine && ((test_caps[j].src_caps | test_caps[j].dst_caps) & DDSCAPS_SYSTEMMEMORY) && (src_format->broken_software_blit || dst_format->broken_software_blit)) continue; + if (!is_wine && (test_caps[j].dst_caps & DDSCAPS_VIDEOMEMORY) + && dst_format->broken_hardware_blit) + continue;
U4(surface_desc).ddpfPixelFormat = src_format->fmt; surface_desc.ddsCaps.dwCaps = test_caps[j].src_caps; diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index cde5d2b5ba5..c2a0ca7e3b9 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -16695,7 +16695,7 @@ static void test_surface_format_conversion_alpha(void) const char *name; unsigned int block_size, x_blocks, y_blocks; DWORD support_flag; - BOOL broken_software_blit; + BOOL broken_software_blit, broken_hardware_blit; } formats[] = { @@ -16735,7 +16735,7 @@ static void test_surface_format_conversion_alpha(void) sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, {16}, {0x00007c00}, {0x000003e0}, {0x0000001f}, {0x00008000} }, - "R5G5B5A1", 2, 4, 4, + "R5G5B5A1", 2, 4, 4, 0, FALSE, TRUE, }, { { @@ -16864,6 +16864,9 @@ static void test_surface_format_conversion_alpha(void) if (!is_wine && ((test_caps[j].src_caps | test_caps[j].dst_caps) & DDSCAPS_SYSTEMMEMORY) && (src_format->broken_software_blit || dst_format->broken_software_blit)) continue; + if (!is_wine && (test_caps[j].dst_caps & DDSCAPS_VIDEOMEMORY) + && dst_format->broken_hardware_blit) + continue;
U4(surface_desc).ddpfPixelFormat = src_format->fmt; surface_desc.ddsCaps.dwCaps = test_caps[j].src_caps;
This is somewhat different from the 16 bit to 16 bit blit failures because the blit happens and the color data is properly converted, but the alpha channel is wrong. Later Radeon GPUs fix this behavior, suggesting that games do depend on it.
Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/ddraw/tests/ddraw7.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index c2a0ca7e3b9..78ff17f28ac 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -16779,6 +16779,7 @@ static void test_surface_format_conversion_alpha(void) enum test_format_id dst_format; const void *expected_data; BOOL todo; + const void *expected_data_broken; } tests[] = { @@ -16788,7 +16789,9 @@ static void test_surface_format_conversion_alpha(void) {FMT_RGBA, rgba_data, FMT_RGBX, rgbx_data}, {FMT_R5G5B5X1, r5g5b5x1_data, FMT_RGBA, rgba_data}, #endif - {FMT_R5G6B5, r5g6b5_data, FMT_RGBA, rgba_data}, + /* r200 zeroes the alpha channel when blitting r5g6b5 to r8g8b8a8. Later radeon GPUs + * work as expected. */ + {FMT_R5G6B5, r5g6b5_data, FMT_RGBA, rgba_data, FALSE, rgbx_data}, {FMT_R5G6B5, r5g6b5_data, FMT_R5G5B5A1, r5g5b5a1_data}, {FMT_R5G5B5X1, r5g5b5x1_data, FMT_R5G5B5A1, r5g5b5x1_data, TRUE}, {FMT_R5G5B5A1, r5g5b5a1_data, FMT_R5G6B5, r5g6b5_data}, @@ -16815,7 +16818,7 @@ static void test_surface_format_conversion_alpha(void) ULONG refcount; BOOL is_wine; HWND window; - BOOL passed; + BOOL passed, results_broken; HRESULT hr;
window = create_window(); @@ -16914,15 +16917,20 @@ static void test_surface_format_conversion_alpha(void) for (y = 0; y < dst_format->y_blocks; ++y) { const void *expected_data = tests[i].expected_data; + const void *expected_data_broken = tests[i].expected_data_broken;
passed = !memcmp((BYTE*)lock.lpSurface + y * pitch, (BYTE *)expected_data + y * dst_format->x_blocks * dst_format->block_size, dst_format->block_size * dst_format->x_blocks); + results_broken = broken(expected_data_broken ? !memcmp((BYTE*)lock.lpSurface + y * pitch, + (BYTE *)expected_data_broken + y * dst_format->x_blocks * dst_format->block_size, + dst_format->block_size * dst_format->x_blocks) : FALSE); todo_wine_if(tests[i].todo) - ok(passed, "Test (%u, %s -> %s), row %u, unexpected surface data.\n", j, + ok(passed || results_broken, + "Test (%u, %s -> %s), row %u, unexpected surface data.\n", j, src_format->name, dst_format->name, y);
- if (!passed && !(is_wine && tests[i].todo)) + if (!passed && !results_broken && !(is_wine && tests[i].todo)) { for (x = 0; x < dst_format->x_blocks * dst_format->block_size / 4; ++x) {
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=63936
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: 0910:ddraw7: unhandled exception c0000005 at 73DE6143
=== wvistau64 (64 bit report) ===
ddraw: 0910:ddraw7: unhandled exception c0000005 at 000007FEF6301883
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
It somehow ends up drawing at z=0.5 instead of z=0.5+eps. Going through a different viewport size first fixes the problem and the test works like everywhere else. Weirdly this only applies to 640x480 target as well (but creating a separate RT+DS doesn't help), not the render targets with higher or lower resolutions.
LEGO Island 2 is broken on this machine, although in a different way than in bug 48104. It lookd as if the GPU does not handle surface tiling correctly. --- dlls/ddraw/tests/ddraw7.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 78ff17f28ac..71244ca1e1d 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -14966,9 +14966,10 @@ static void test_viewport(void) tests[] = { {{ 0, 0, 640, 480}, 0.001f, { 0, 120, 479, 359}, "Viewport (0, 0) - (640, 480)"}, + {{ 0, 0, 320, 240}, 0.001f, { 0, 60, 239, 179}, "Viewport (0, 0) - (320, 240)"}, + /* Don't run this right after the other 640x480 test, it breaks r500. */ {{ 0, 0, 640, 480, 0.5f, 0.0f}, 0.501f, {0, 120, 479, 359}, "Viewport (0, 0, 0.5) - (640, 480, 0.0)"}, - {{ 0, 0, 320, 240}, 0.001f, { 0, 60, 239, 179}, "Viewport (0, 0) - (320, 240)"}, {{ 0, 0, 1280, 960}, 0.001f, { 0, 240, 639, 479}, "Viewport (0, 0) - (1280, 960)"}, {{ 0, 0, 2000, 1600}, 0.001f, {-10, -10, -10, -10}, "Viewport (0, 0) - (2000, 1600)"}, {{100, 100, 640, 480}, 0.001f, {100, 220, 579, 459}, "Viewport (100, 100) - (640, 480)"},
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=63937
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: 06e4:ddraw7: unhandled exception c0000005 at 74196143
=== wvistau64 (64 bit report) ===
ddraw: 0910:ddraw7: unhandled exception c0000005 at 000007FEF6301883
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/ddraw/tests/ddraw7.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 71244ca1e1d..75d11fcac32 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -148,6 +148,11 @@ static BOOL ddraw_is_vmware(IDirectDraw7 *ddraw) return ddraw_is_vendor(ddraw, 0x15ad); }
+static BOOL ddraw_is_amd(IDirectDraw7 *ddraw) +{ + return ddraw_is_vendor(ddraw, 0x1002); +} + static IDirectDrawSurface7 *create_overlay(IDirectDraw7 *ddraw, unsigned int width, unsigned int height, DWORD format) { @@ -12854,6 +12859,7 @@ static void test_draw_primitive(void) IDirect3DVertexBuffer7 *vb; IDirect3DDevice7 *device; IDirect3D7 *d3d; + IDirectDraw7 *ddraw; ULONG refcount; HWND window; HRESULT hr; @@ -12869,6 +12875,8 @@ static void test_draw_primitive(void)
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); ok(SUCCEEDED(hr), "Failed to get D3D interface, hr %#x.\n", hr); + hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr);
memset(&vb_desc, 0, sizeof(vb_desc)); vb_desc.dwSize = sizeof(vb_desc); @@ -12891,19 +12899,21 @@ static void test_draw_primitive(void) hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, NULL, 0, 0); ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + /* r200 rejects 0 vertices */ + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, 0); ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, indices, 4, 0); ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, indices, 4, 0); ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + /* Interestingly r200 rejects this, but not the call with a NULL index buffer and 0 indices. */ hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, indices, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr);
strided.position.lpvData = quad; strided.position.dwStride = sizeof(*quad); @@ -12917,11 +12927,14 @@ static void test_draw_primitive(void) ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 4, NULL, 0, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + /* r200 again fails this, this time with E_OUTOFMEMORY. */ + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_OUTOFMEMORY), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, NULL, 0, 0); ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + /* Now this draw should work, but r200 rejects it too - presumably earlier tests broke + * driver internal state. */ hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); - ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(ddraw_is_amd(ddraw) && hr == E_FAIL), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 4, 0); ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); @@ -12936,6 +12949,7 @@ static void test_draw_primitive(void) ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
IDirect3DVertexBuffer7_Release(vb); + IDirectDraw7_Release(ddraw); refcount = IDirect3DDevice7_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); DestroyWindow(window);
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=63938
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: 0914:ddraw7: unhandled exception c0000005 at 73DE6143
=== wvistau64 (64 bit report) ===
ddraw: 02d8:ddraw7: unhandled exception c0000005 at 000007FEF6301883
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
We got away with this by pure luck because the value was set to something huge, which is ignored for the specific combination of version 7 sysmem texture. --- dlls/ddraw/tests/ddraw7.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 75d11fcac32..dabd1747c5f 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -17088,6 +17088,9 @@ static void test_compressed_surface_stretch(void) memset(&fx, 0, sizeof(fx)); fx.dwSize = sizeof(fx);
+ memset(&lock, 0, sizeof(lock)); + lock.dwSize = sizeof(lock); + for (i = 0; i < ARRAY_SIZE(test_caps); ++i) { src_surface_desc.ddsCaps.dwCaps = test_caps[i].src_caps;
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=63939
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: 0914:ddraw7: unhandled exception c0000005 at 74126143
=== wvistau64 (64 bit report) ===
ddraw: 02d8:ddraw7: unhandled exception c0000005 at 000007FEF6301883
=== w2008s64 (64 bit report) ===
ddraw: ddraw7.c:5065: Test failed: Expected WM_ACTIVATEAPP, but did not receive it.
Signed-off-by: Henri Verbeet hverbeet@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=63935
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: 06e4:ddraw4: unhandled exception c0000005 at 74126143
=== wvistau64 (64 bit report) ===
ddraw: 0910:ddraw4: unhandled exception c0000005 at 000007FEF6301883
=== wvistau64 (32 bit report) ===
ddraw: 06e4:ddraw7: unhandled exception c0000005 at 74126143
=== wvistau64 (64 bit report) ===
ddraw: 0910:ddraw7: unhandled exception c0000005 at 000007FEF6301883