[PATCH 2/5] ddraw/tests: r200 zeroes the alpha channel in r5g6b5->r8g8b8a8 blits.

Stefan Dösinger stefan at codeweavers.com
Mon Jan 27 15:45:25 CST 2020


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 at 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)
                     {
-- 
2.24.1




More information about the wine-devel mailing list