summaryrefslogtreecommitdiff
path: root/patches/mesa-mesa/0002-Add-some-slop-to-u_format_test-for-8unorm-formats.patch
blob: e8d8265a0e81840a43f82457dbbe17a910b75f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 0dcb1d0941303fbcb00620e2abd69e0f7a4b064e Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Thu, 14 Mar 2019 14:56:18 +0000
Subject: [PATCH 2/2] Add some slop to u_format_test for 8unorm formats

There seems to be some rounding ocurring here on my buildbot slave
hardware.
---
 src/gallium/tests/unit/u_format_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/tests/unit/u_format_test.c b/src/gallium/tests/unit/u_format_test.c
index 640214dfc50..102bbefb1cf 100644
--- a/src/gallium/tests/unit/u_format_test.c
+++ b/src/gallium/tests/unit/u_format_test.c
@@ -369,7 +369,8 @@ test_format_unpack_rgba_8unorm(const struct util_format_description *format_desc
    for (i = 0; i < format_desc->block.height; ++i) {
       for (j = 0; j < format_desc->block.width; ++j) {
          for (k = 0; k < 4; ++k) {
-            if (expected[i][j][k] != unpacked[i][j][k]) {
+            int error = abs(expected[i][j][k] - unpacked[i][j][k]);
+            if (error > 1) {
                success = FALSE;
             }
          }
-- 
2.17.0