From 8548efbe1d2ebc9cfe5636d3e0f3064958ad0644 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 1 Apr 2010 14:43:35 +0100 Subject: util: Get DXT1_RGB format working correctly. --- progs/gallium/unit/u_format_test.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'progs/gallium/unit') diff --git a/progs/gallium/unit/u_format_test.c b/progs/gallium/unit/u_format_test.c index 9cead79589..be47b15d90 100644 --- a/progs/gallium/unit/u_format_test.c +++ b/progs/gallium/unit/u_format_test.c @@ -44,7 +44,6 @@ compare_float(float x, float y) error = -error; if (error > FLT_EPSILON) { - printf("error = %g\n", error); return FALSE; } @@ -201,6 +200,15 @@ test_format_pack_float(const struct util_format_description *format_desc, unsigned i, j, k; boolean success; + if (format_desc->layout == UTIL_FORMAT_LAYOUT_S3TC) { + /* + * Skip S3TC as packed representation is not canonical. + * + * TODO: Do a round trip conversion. + */ + return TRUE; + } + memset(packed, 0, sizeof packed); for (i = 0; i < format_desc->block.height; ++i) { for (j = 0; j < format_desc->block.width; ++j) { @@ -259,7 +267,7 @@ test_format_unpack_8unorm(const struct util_format_description *format_desc, unsigned i, j, k; boolean success; - format_desc->unpack_8unorm(&unpacked[0][0][0], 0, test->packed, 0, 1, 1); + format_desc->unpack_8unorm(&unpacked[0][0][0], sizeof unpacked[0], test->packed, 0, 1, 1); convert_float_to_8unorm(&expected[0][0][0], &test->unpacked[0][0][0]); @@ -292,6 +300,15 @@ test_format_pack_8unorm(const struct util_format_description *format_desc, unsigned i; boolean success; + if (format_desc->layout == UTIL_FORMAT_LAYOUT_S3TC) { + /* + * Skip S3TC as packed representation is not canonical. + * + * TODO: Do a round trip conversion. + */ + return TRUE; + } + if (!convert_float_to_8unorm(&unpacked[0][0][0], &test->unpacked[0][0][0])) { /* * Skip test cases which cannot be represented by four unorm bytes. -- cgit v1.2.3