Commit 24187d53 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw/tests: Nvidia has an off-by-one rectangle handling bug.

parent 2bf09a15
...@@ -556,6 +556,21 @@ static void test_clipper_blt(void) ...@@ -556,6 +556,21 @@ static void test_clipper_blt(void)
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
}; };
/* Nvidia on Windows seems to have an off-by-one error
* when processing source rectangles. Our left = 1 and
* right = 5 input reads from x = {1, 2, 3}. x = 4 is
* read as well, but only for the edge pixels on the
* output image. The bug happens on the y axis as well,
* but we only read one row there, and all source rows
* contain the same data. This bug is not dependent on
* the presence of a clipper. */
static const D3DCOLOR expected1_broken[] =
{
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000,
0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000,
};
static const D3DCOLOR expected2[] = static const D3DCOLOR expected2[] =
{ {
0x000000ff, 0x000000ff, 0x00000000, 0x00000000, 0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
...@@ -669,7 +684,8 @@ static void test_clipper_blt(void) ...@@ -669,7 +684,8 @@ static void test_clipper_blt(void)
x = 80 * ((2 * j) + 1); x = 80 * ((2 * j) + 1);
y = 60 * ((2 * i) + 1); y = 60 * ((2 * i) + 1);
color = get_surface_color(dst_surface, x, y); color = get_surface_color(dst_surface, x, y);
ok(compare_color(color, expected1[i * 4 + j], 1), ok(compare_color(color, expected1[i * 4 + j], 1)
|| broken(compare_color(color, expected1_broken[i * 4 + j], 1)),
"Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color);
} }
} }
......
...@@ -504,6 +504,21 @@ static void test_clipper_blt(void) ...@@ -504,6 +504,21 @@ static void test_clipper_blt(void)
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
}; };
/* Nvidia on Windows seems to have an off-by-one error
* when processing source rectangles. Our left = 1 and
* right = 5 input reads from x = {1, 2, 3}. x = 4 is
* read as well, but only for the edge pixels on the
* output image. The bug happens on the y axis as well,
* but we only read one row there, and all source rows
* contain the same data. This bug is not dependent on
* the presence of a clipper. */
static const D3DCOLOR expected1_broken[] =
{
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000,
0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000,
};
static const D3DCOLOR expected2[] = static const D3DCOLOR expected2[] =
{ {
0x000000ff, 0x000000ff, 0x00000000, 0x00000000, 0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
...@@ -617,7 +632,8 @@ static void test_clipper_blt(void) ...@@ -617,7 +632,8 @@ static void test_clipper_blt(void)
x = 80 * ((2 * j) + 1); x = 80 * ((2 * j) + 1);
y = 60 * ((2 * i) + 1); y = 60 * ((2 * i) + 1);
color = get_surface_color(dst_surface, x, y); color = get_surface_color(dst_surface, x, y);
ok(compare_color(color, expected1[i * 4 + j], 1), ok(compare_color(color, expected1[i * 4 + j], 1)
|| broken(compare_color(color, expected1_broken[i * 4 + j], 1)),
"Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color);
} }
} }
......
...@@ -696,6 +696,21 @@ static void test_clipper_blt(void) ...@@ -696,6 +696,21 @@ static void test_clipper_blt(void)
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
}; };
/* Nvidia on Windows seems to have an off-by-one error
* when processing source rectangles. Our left = 1 and
* right = 5 input reads from x = {1, 2, 3}. x = 4 is
* read as well, but only for the edge pixels on the
* output image. The bug happens on the y axis as well,
* but we only read one row there, and all source rows
* contain the same data. This bug is not dependent on
* the presence of a clipper. */
static const D3DCOLOR expected1_broken[] =
{
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000,
0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000,
};
static const D3DCOLOR expected2[] = static const D3DCOLOR expected2[] =
{ {
0x000000ff, 0x000000ff, 0x00000000, 0x00000000, 0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
...@@ -809,7 +824,8 @@ static void test_clipper_blt(void) ...@@ -809,7 +824,8 @@ static void test_clipper_blt(void)
x = 80 * ((2 * j) + 1); x = 80 * ((2 * j) + 1);
y = 60 * ((2 * i) + 1); y = 60 * ((2 * i) + 1);
color = get_surface_color(dst_surface, x, y); color = get_surface_color(dst_surface, x, y);
ok(compare_color(color, expected1[i * 4 + j], 1), ok(compare_color(color, expected1[i * 4 + j], 1)
|| broken(compare_color(color, expected1_broken[i * 4 + j], 1)),
"Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color);
} }
} }
......
...@@ -670,6 +670,21 @@ static void test_clipper_blt(void) ...@@ -670,6 +670,21 @@ static void test_clipper_blt(void)
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff,
}; };
/* Nvidia on Windows seems to have an off-by-one error
* when processing source rectangles. Our left = 1 and
* right = 5 input reads from x = {1, 2, 3}. x = 4 is
* read as well, but only for the edge pixels on the
* output image. The bug happens on the y axis as well,
* but we only read one row there, and all source rows
* contain the same data. This bug is not dependent on
* the presence of a clipper. */
static const D3DCOLOR expected1_broken[] =
{
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000,
0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000,
};
static const D3DCOLOR expected2[] = static const D3DCOLOR expected2[] =
{ {
0x000000ff, 0x000000ff, 0x00000000, 0x00000000, 0x000000ff, 0x000000ff, 0x00000000, 0x00000000,
...@@ -783,7 +798,8 @@ static void test_clipper_blt(void) ...@@ -783,7 +798,8 @@ static void test_clipper_blt(void)
x = 80 * ((2 * j) + 1); x = 80 * ((2 * j) + 1);
y = 60 * ((2 * i) + 1); y = 60 * ((2 * i) + 1);
color = get_surface_color(dst_surface, x, y); color = get_surface_color(dst_surface, x, y);
ok(compare_color(color, expected1[i * 4 + j], 1), ok(compare_color(color, expected1[i * 4 + j], 1)
|| broken(compare_color(color, expected1_broken[i * 4 + j], 1)),
"Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment