summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorJames Benton <[email protected]>2012-06-12 12:12:16 +0100
committerJosé Fonseca <[email protected]>2012-06-29 12:20:59 +0100
commitc8d3481cdb12a10e02b23d65c73017ce5925cde7 (patch)
treea8ad8f5fa46bb88e95fe57edd08326cb7cd24591 /src/gallium/drivers/llvmpipe
parent60dca53833ee6ed39d75a24af3edb0b8ac3f7e0d (diff)
tests: Updated tests to properly handle NaN for half floats.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_format.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c
index 6aca66dc700..daf6ded29c7 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_format.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_format.c
@@ -262,8 +262,13 @@ test_format_unorm8(struct gallivm_state *gallivm,
match = TRUE;
for(k = 0; k < 4; ++k) {
int error = float_to_ubyte(test->unpacked[i][j][k]) - unpacked[k];
+
+ if (util_is_double_nan(test->unpacked[i][j][k]))
+ continue;
+
if (error < 0)
error = -error;
+
if (error > 1)
match = FALSE;
}
@@ -337,6 +342,7 @@ test_all(struct gallivm_state *gallivm, unsigned verbose, FILE *fp)
continue;
}
+
/*
* TODO: test more
*/