diff options
author | Juan A. Suarez Romero <jasuarez@igalia.com> | 2024-04-02 13:58:41 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-19 10:11:06 +0000 |
commit | 9be2db1989357402859cb4e83ea0d40f01cdd2d4 (patch) | |
tree | 148d3c0b3e2b8d1808295684e082af5e2fad5e7c | |
parent | 7f40f35a34010675ccbdf5bc583920f0d10968e6 (diff) |
Reduce precision in depth clear precision check
For depth16 and depth24, let's reduce the precision of the float values
used as depth.
This makes the depth-clear-precision tests pass on rpi4 devices.
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/899>
-rw-r--r-- | tests/general/depth-clear-precision-check.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/general/depth-clear-precision-check.c b/tests/general/depth-clear-precision-check.c index 318df08d1..c2fc3573c 100644 --- a/tests/general/depth-clear-precision-check.c +++ b/tests/general/depth-clear-precision-check.c @@ -34,6 +34,8 @@ const struct piglit_subtest subtests[]; enum piglit_result test(void *data); static struct piglit_gl_test_config *piglit_config; +#define ftoh(x) (piglit_float_from_half(piglit_half_from_float(x))) + PIGLIT_GL_TEST_CONFIG_BEGIN piglit_config = &config; @@ -217,6 +219,9 @@ test(void *data) assert(maxStoreableValue * fdepth == depth); + if (numOfBits < 32) + fdepth = ftoh(depth / (float)maxStoreableValue); + pass = check_color(fdepth); if (!pass) { |