Only report the first failed row for each bias clamp test.
Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
It was established that ok() does not print anything when successful so this patch actually works (which I can confirm from my tests). So I'm resubmitting.
dlls/d3d10core/tests/d3d10core.c | 12 ++++++++---- dlls/d3d11/tests/d3d11.c | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index f799922ea28..b0ff09d3697 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -15765,6 +15765,7 @@ static void test_depth_bias(void)
for (k = 0; k < ARRAY_SIZE(bias_clamp_tests); ++k) { + BOOL all_match = TRUE; rasterizer_desc.DepthBiasClamp = bias_clamp_tests[k]; ID3D10Device_CreateRasterizerState(device, &rasterizer_desc, &rs); ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); @@ -15775,21 +15776,23 @@ static void test_depth_bias(void) m = quad_slopes[i] / texture_desc.Height; bias = clamp_depth_bias(rasterizer_desc.SlopeScaledDepthBias * m, rasterizer_desc.DepthBiasClamp); get_texture_readback(texture, 0, &rb); - for (y = 0; y < texture_desc.Height; ++y) + for (y = 0; y < texture_desc.Height && all_match; ++y) { depth = min(max(0.0f, depth_values[y] + bias), 1.0f); switch (format) { case DXGI_FORMAT_D32_FLOAT: data = get_readback_float(&rb, 0, y); - ok(compare_float(data, depth, 64), + all_match = compare_float(data, depth, 64); + ok(all_match, "Got depth %.8e, expected %.8e.\n", data, depth); break; case DXGI_FORMAT_D24_UNORM_S8_UINT: u32 = get_readback_data(&rb, 0, y, sizeof(*u32)); u32_value = *u32 >> shift; expected_value = depth * 16777215.0f + 0.5f; - ok(abs(u32_value - expected_value) <= 3, + all_match = abs(u32_value - expected_value) <= 3; + ok(all_match, "Got value %#x (%.8e), expected %#x (%.8e).\n", u32_value, u32_value / 16777215.0f, expected_value, expected_value / 16777215.0f); @@ -15797,7 +15800,8 @@ static void test_depth_bias(void) case DXGI_FORMAT_D16_UNORM: u16 = get_readback_data(&rb, 0, y, sizeof(*u16)); expected_value = depth * 65535.0f + 0.5f; - ok(abs(*u16 - expected_value) <= 1, + all_match = abs(*u16 - expected_value) <= 1; + ok(all_match, "Got value %#x (%.8e), expected %#x (%.8e).\n", *u16, *u16 / 65535.0f, expected_value, expected_value / 65535.0f); break; diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 3d6cbf57e20..2850d59757e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -25681,6 +25681,7 @@ static void test_depth_bias(void)
for (k = 0; k < ARRAY_SIZE(bias_clamp_tests); ++k) { + BOOL all_match = TRUE; rasterizer_desc.DepthBiasClamp = bias_clamp_tests[k]; ID3D11Device_CreateRasterizerState(device, &rasterizer_desc, &rs); ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); @@ -25691,21 +25692,23 @@ static void test_depth_bias(void) m = quad_slopes[i] / texture_desc.Height; bias = clamp_depth_bias(rasterizer_desc.SlopeScaledDepthBias * m, rasterizer_desc.DepthBiasClamp); get_texture_readback(texture, 0, &rb); - for (y = 0; y < texture_desc.Height; ++y) + for (y = 0; y < texture_desc.Height && all_match; ++y) { depth = min(max(0.0f, depth_values[y] + bias), 1.0f); switch (format) { case DXGI_FORMAT_D32_FLOAT: data = get_readback_float(&rb, 0, y); - ok(compare_float(data, depth, 64), + all_match = compare_float(data, depth, 64); + ok(all_match, "Got depth %.8e, expected %.8e.\n", data, depth); break; case DXGI_FORMAT_D24_UNORM_S8_UINT: u32 = get_readback_data(&rb, 0, y, 0, sizeof(*u32)); u32_value = *u32 >> shift; expected_value = depth * 16777215.0f + 0.5f; - ok(abs(u32_value - expected_value) <= 3, + all_match = abs(u32_value - expected_value) <= 3; + ok(all_match, "Got value %#x (%.8e), expected %#x (%.8e).\n", u32_value, u32_value / 16777215.0f, expected_value, expected_value / 16777215.0f); @@ -25713,7 +25716,8 @@ static void test_depth_bias(void) case DXGI_FORMAT_D16_UNORM: u16 = get_readback_data(&rb, 0, y, 0, sizeof(*u16)); expected_value = depth * 65535.0f + 0.5f; - ok(abs(*u16 - expected_value) <= 1, + all_match = abs(*u16 - expected_value) <= 1; + ok(all_match, "Got value %#x (%.8e), expected %#x (%.8e).\n", *u16, *u16 / 65535.0f, expected_value, expected_value / 65535.0f); break;
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=51491
Your paranoid android.
=== debian9 (32 bit report) ===
d3d11: d3d11.c:6022: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16770: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
=== debian9 (32 bit French report) ===
d3d10core: d3d10core.c:4921: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d10core.c:12549: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
d3d11: d3d11.c:6032: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16770: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
=== debian9 (32 bit Japanese:Japan report) ===
d3d10core: d3d10core.c:4931: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d10core.c:12549: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
d3d11: d3d11.c:6032: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16770: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 1, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 1, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 2, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 2, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 3, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27467: Test failed: Resource type 3, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:25703: Test failed: Got depth 2.51951814e-003, expected 2.51948950e-003. d3d11.c:25703: Test failed: Got depth 2.51951814e-003, expected 2.51948950e-003. d3d11.c:25703: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25703: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25703: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25703: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25703: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25703: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25703: Test failed: Got depth 5.03277779e-003, expected 5.03897900e-003. d3d11.c:25703: Test failed: Got depth 5.03277779e-003, expected 5.03897900e-003. d3d11.c:25703: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25703: Test failed: Got depth 7.52645731e-003, expected 7.53897894e-003. d3d11.c:25703: Test failed: Got depth 7.52645731e-003, expected 7.53897894e-003. d3d11.c:25703: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25703: Test failed: Got depth 1.25139356e-002, expected 1.25389788e-002. d3d11.c:25703: Test failed: Got depth 1.25139356e-002, expected 1.25389788e-002. d3d11.c:25703: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25703: Test failed: Got depth 6.40938997e-001, expected 6.42538965e-001. d3d11.c:25703: Test failed: Got depth 6.40938997e-001, expected 6.42538965e-001. d3d11.c:25703: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25703: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25703: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25711: Test failed: Got value 0x149d4 (5.03277809e-003), expected 0x14a3c (5.03897697e-003). d3d11.c:25711: Test failed: Got value 0x149d4 (5.03277809e-003), expected 0x14a3c (5.03897697e-003). d3d11.c:25711: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25711: Test failed: Got value 0x1ed41 (7.52645776e-003), expected 0x1ee13 (7.53897473e-003). d3d11.c:25711: Test failed: Got value 0x1ed41 (7.52645776e-003), expected 0x1ee13 (7.53897473e-003). d3d11.c:25711: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25711: Test failed: Got value 0x3341d (1.25139363e-002), expected 0x335c1 (1.25389703e-002). d3d11.c:25711: Test failed: Got value 0x3341d (1.25139363e-002), expected 0x335c1 (1.25389703e-002). d3d11.c:25711: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25711: Test failed: Got value 0xa41493 (6.40938976e-001), expected 0xa47d6e (6.42538943e-001). d3d11.c:25711: Test failed: Got value 0xa41493 (6.40938976e-001), expected 0xa47d6e (6.42538943e-001). d3d11.c:25711: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25711: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25711: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25720: Test failed: Got value 0x3d8 (1.50148775e-002), expected 0x3da (1.50453956e-002). d3d11.c:25720: Test failed: Got value 0x3d8 (1.50148775e-002), expected 0x3da (1.50453956e-002). d3d11.c:25720: Test failed: Got value 0x333 (1.24971389e-002), expected 0x336 (1.25429160e-002). d3d11.c:25720: Test failed: Got value 0x333 (1.24971389e-002), expected 0x336 (1.25429160e-002). d3d11.c:25720: Test failed: Got value 0x479 (1.74715801e-002), expected 0x47d (1.75326162e-002). d3d11.c:25720: Test failed: Got value 0x479 (1.74715801e-002), expected 0x47d (1.75326162e-002). d3d11.c:25720: Test failed: Got value 0xa414 (6.40939956e-001), expected 0xa47c (6.42526894e-001). d3d11.c:25720: Test failed: Got value 0xa414 (6.40939956e-001), expected 0xa47c (6.42526894e-001).
Report errors: d3d11:d3d11 prints too much data (35040 bytes)
=== debian9 (32 bit Chinese:China report) ===
d3d10core: d3d10core.c:12549: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
d3d11: d3d11.c:6032: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16770: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
=== debian9 (32 bit WoW report) ===
d3d10core: d3d10core.c:4921: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
d3d11: d3d11.c:6032: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian9 (64 bit WoW report) ===
d3d11: d3d11.c:6022: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:6032: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.