On Tue, 16 Apr 2019 at 19:51, Francois Gouget fgouget@codeweavers.com wrote:
@@ -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;
This doesn't reduce the number of ok() call all that much though. It will abort earlier on failure, but successful runs are going to produce the same amount of data as before. You'd want to move the ok() calls out of the loop as well, as is done in the various check_readback_data_*() helpers.