1 /**************************************************************************
3 * Copyright 2009-2010 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
33 #include "util/u_half.h"
34 #include "util/format/u_format.h"
35 #include "util/format/u_format_tests.h"
36 #include "util/format/u_format_s3tc.h"
40 compare_float(float x
, float y
)
47 if (error
> FLT_EPSILON
) {
56 print_packed(const struct util_format_description
*format_desc
,
58 const uint8_t *packed
,
65 for (i
= 0; i
< format_desc
->block
.bits
/8; ++i
) {
66 printf("%s%02x", sep
, packed
[i
]);
75 print_unpacked_rgba_doubl(const struct util_format_description
*format_desc
,
77 const double unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4],
84 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
85 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
86 printf("%s{%f, %f, %f, %f}", sep
, unpacked
[i
][j
][0], unpacked
[i
][j
][1], unpacked
[i
][j
][2], unpacked
[i
][j
][3]);
97 print_unpacked_rgba_float(const struct util_format_description
*format_desc
,
99 float unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4],
103 const char *sep
= "";
105 printf("%s", prefix
);
106 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
107 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
108 printf("%s{%f, %f, %f, %f}", sep
, unpacked
[i
][j
][0], unpacked
[i
][j
][1], unpacked
[i
][j
][2], unpacked
[i
][j
][3]);
113 printf("%s", suffix
);
119 print_unpacked_rgba_8unorm(const struct util_format_description
*format_desc
,
121 uint8_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4],
125 const char *sep
= "";
127 printf("%s", prefix
);
128 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
129 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
130 printf("%s{0x%02x, 0x%02x, 0x%02x, 0x%02x}", sep
, unpacked
[i
][j
][0], unpacked
[i
][j
][1], unpacked
[i
][j
][2], unpacked
[i
][j
][3]);
134 printf("%s", suffix
);
140 print_unpacked_z_float(const struct util_format_description
*format_desc
,
142 float unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
],
146 const char *sep
= "";
148 printf("%s", prefix
);
149 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
150 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
151 printf("%s%f", sep
, unpacked
[i
][j
]);
156 printf("%s", suffix
);
162 print_unpacked_z_32unorm(const struct util_format_description
*format_desc
,
164 uint32_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
],
168 const char *sep
= "";
170 printf("%s", prefix
);
171 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
172 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
173 printf("%s0x%08x", sep
, unpacked
[i
][j
]);
177 printf("%s", suffix
);
183 print_unpacked_s_8uint(const struct util_format_description
*format_desc
,
185 uint8_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
],
189 const char *sep
= "";
191 printf("%s", prefix
);
192 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
193 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
194 printf("%s0x%02x", sep
, unpacked
[i
][j
]);
198 printf("%s", suffix
);
204 test_format_fetch_rgba_float(const struct util_format_description
*format_desc
,
205 const struct util_format_test_case
*test
)
207 float unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4] = { { { 0 } } };
212 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
213 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
214 format_desc
->fetch_rgba_float(unpacked
[i
][j
], test
->packed
, j
, i
);
215 for (k
= 0; k
< 4; ++k
) {
216 if (!compare_float(test
->unpacked
[i
][j
][k
], unpacked
[i
][j
][k
])) {
223 /* Ignore S3TC errors */
224 if (format_desc
->layout
== UTIL_FORMAT_LAYOUT_S3TC
) {
229 print_unpacked_rgba_float(format_desc
, "FAILED: ", unpacked
, " obtained\n");
230 print_unpacked_rgba_doubl(format_desc
, " ", test
->unpacked
, " expected\n");
238 test_format_unpack_rgba(const struct util_format_description
*format_desc
,
239 const struct util_format_test_case
*test
)
241 float unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4] = { { { 0 } } };
245 format_desc
->unpack_rgba(&unpacked
[0][0][0], sizeof unpacked
[0],
247 format_desc
->block
.width
, format_desc
->block
.height
);
250 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
251 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
252 for (k
= 0; k
< 4; ++k
) {
253 if (!compare_float(test
->unpacked
[i
][j
][k
], unpacked
[i
][j
][k
])) {
260 /* Ignore S3TC errors */
261 if (format_desc
->layout
== UTIL_FORMAT_LAYOUT_S3TC
) {
266 print_unpacked_rgba_float(format_desc
, "FAILED: ", unpacked
, " obtained\n");
267 print_unpacked_rgba_doubl(format_desc
, " ", test
->unpacked
, " expected\n");
275 test_format_pack_rgba_float(const struct util_format_description
*format_desc
,
276 const struct util_format_test_case
*test
)
278 float unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4];
279 uint8_t packed
[UTIL_FORMAT_MAX_PACKED_BYTES
];
283 if (test
->format
== PIPE_FORMAT_DXT1_RGBA
) {
285 * Skip S3TC as packed representation is not canonical.
287 * TODO: Do a round trip conversion.
292 memset(packed
, 0, sizeof packed
);
293 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
294 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
295 for (k
= 0; k
< 4; ++k
) {
296 unpacked
[i
][j
][k
] = (float) test
->unpacked
[i
][j
][k
];
301 format_desc
->pack_rgba_float(packed
, 0,
302 &unpacked
[0][0][0], sizeof unpacked
[0],
303 format_desc
->block
.width
, format_desc
->block
.height
);
306 for (i
= 0; i
< format_desc
->block
.bits
/8; ++i
) {
307 if ((test
->packed
[i
] & test
->mask
[i
]) != (packed
[i
] & test
->mask
[i
]))
312 if (util_is_double_nan(test
->unpacked
[0][0][0]))
315 /* Ignore S3TC errors */
316 if (format_desc
->layout
== UTIL_FORMAT_LAYOUT_S3TC
) {
321 print_packed(format_desc
, "FAILED: ", packed
, " obtained\n");
322 print_packed(format_desc
, " ", test
->packed
, " expected\n");
330 convert_float_to_8unorm(uint8_t *dst
, const double *src
)
333 boolean accurate
= TRUE
;
335 for (i
= 0; i
< UTIL_FORMAT_MAX_UNPACKED_HEIGHT
*UTIL_FORMAT_MAX_UNPACKED_WIDTH
*4; ++i
) {
340 else if (src
[i
] > 1.0) {
345 dst
[i
] = src
[i
] * 255.0;
354 test_format_unpack_rgba_8unorm(const struct util_format_description
*format_desc
,
355 const struct util_format_test_case
*test
)
357 uint8_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4] = { { { 0 } } };
358 uint8_t expected
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4] = { { { 0 } } };
362 if (util_format_is_pure_integer(format_desc
->format
))
365 format_desc
->unpack_rgba_8unorm(&unpacked
[0][0][0], sizeof unpacked
[0],
367 format_desc
->block
.width
, format_desc
->block
.height
);
369 convert_float_to_8unorm(&expected
[0][0][0], &test
->unpacked
[0][0][0]);
372 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
373 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
374 for (k
= 0; k
< 4; ++k
) {
375 if (expected
[i
][j
][k
] != unpacked
[i
][j
][k
]) {
383 if (util_is_double_nan(test
->unpacked
[0][0][0]))
387 print_unpacked_rgba_8unorm(format_desc
, "FAILED: ", unpacked
, " obtained\n");
388 print_unpacked_rgba_8unorm(format_desc
, " ", expected
, " expected\n");
396 test_format_pack_rgba_8unorm(const struct util_format_description
*format_desc
,
397 const struct util_format_test_case
*test
)
399 uint8_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
][4];
400 uint8_t packed
[UTIL_FORMAT_MAX_PACKED_BYTES
];
404 if (test
->format
== PIPE_FORMAT_DXT1_RGBA
) {
406 * Skip S3TC as packed representation is not canonical.
408 * TODO: Do a round trip conversion.
413 if (!convert_float_to_8unorm(&unpacked
[0][0][0], &test
->unpacked
[0][0][0])) {
415 * Skip test cases which cannot be represented by four unorm bytes.
420 memset(packed
, 0, sizeof packed
);
422 format_desc
->pack_rgba_8unorm(packed
, 0,
423 &unpacked
[0][0][0], sizeof unpacked
[0],
424 format_desc
->block
.width
, format_desc
->block
.height
);
427 for (i
= 0; i
< format_desc
->block
.bits
/8; ++i
)
428 if ((test
->packed
[i
] & test
->mask
[i
]) != (packed
[i
] & test
->mask
[i
]))
432 if (util_is_double_nan(test
->unpacked
[0][0][0]))
435 /* Ignore failure cases due to unorm8 format */
436 if (test
->unpacked
[0][0][0] > 1.0f
|| test
->unpacked
[0][0][0] < 0.0f
)
439 /* Multiple of 255 */
440 if ((test
->unpacked
[0][0][0] * 255.0) != (int)(test
->unpacked
[0][0][0] * 255.0))
443 /* Ignore S3TC errors */
444 if (format_desc
->layout
== UTIL_FORMAT_LAYOUT_S3TC
) {
449 print_packed(format_desc
, "FAILED: ", packed
, " obtained\n");
450 print_packed(format_desc
, " ", test
->packed
, " expected\n");
458 test_format_unpack_z_float(const struct util_format_description
*format_desc
,
459 const struct util_format_test_case
*test
)
461 float unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
] = { { 0 } };
465 format_desc
->unpack_z_float(&unpacked
[0][0], sizeof unpacked
[0],
467 format_desc
->block
.width
, format_desc
->block
.height
);
470 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
471 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
472 if (!compare_float(test
->unpacked
[i
][j
][0], unpacked
[i
][j
])) {
479 print_unpacked_z_float(format_desc
, "FAILED: ", unpacked
, " obtained\n");
480 print_unpacked_rgba_doubl(format_desc
, " ", test
->unpacked
, " expected\n");
488 test_format_pack_z_float(const struct util_format_description
*format_desc
,
489 const struct util_format_test_case
*test
)
491 float unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
];
492 uint8_t packed
[UTIL_FORMAT_MAX_PACKED_BYTES
];
496 memset(packed
, 0, sizeof packed
);
497 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
498 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
499 unpacked
[i
][j
] = (float) test
->unpacked
[i
][j
][0];
500 if (test
->unpacked
[i
][j
][1]) {
506 format_desc
->pack_z_float(packed
, 0,
507 &unpacked
[0][0], sizeof unpacked
[0],
508 format_desc
->block
.width
, format_desc
->block
.height
);
511 for (i
= 0; i
< format_desc
->block
.bits
/8; ++i
)
512 if ((test
->packed
[i
] & test
->mask
[i
]) != (packed
[i
] & test
->mask
[i
]))
516 print_packed(format_desc
, "FAILED: ", packed
, " obtained\n");
517 print_packed(format_desc
, " ", test
->packed
, " expected\n");
525 test_format_unpack_z_32unorm(const struct util_format_description
*format_desc
,
526 const struct util_format_test_case
*test
)
528 uint32_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
] = { { 0 } };
529 uint32_t expected
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
] = { { 0 } };
533 format_desc
->unpack_z_32unorm(&unpacked
[0][0], sizeof unpacked
[0],
535 format_desc
->block
.width
, format_desc
->block
.height
);
537 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
538 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
539 expected
[i
][j
] = test
->unpacked
[i
][j
][0] * 0xffffffff;
544 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
545 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
546 if (expected
[i
][j
] != unpacked
[i
][j
]) {
553 print_unpacked_z_32unorm(format_desc
, "FAILED: ", unpacked
, " obtained\n");
554 print_unpacked_z_32unorm(format_desc
, " ", expected
, " expected\n");
562 test_format_pack_z_32unorm(const struct util_format_description
*format_desc
,
563 const struct util_format_test_case
*test
)
565 uint32_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
];
566 uint8_t packed
[UTIL_FORMAT_MAX_PACKED_BYTES
];
570 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
571 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
572 unpacked
[i
][j
] = test
->unpacked
[i
][j
][0] * 0xffffffff;
573 if (test
->unpacked
[i
][j
][1]) {
579 memset(packed
, 0, sizeof packed
);
581 format_desc
->pack_z_32unorm(packed
, 0,
582 &unpacked
[0][0], sizeof unpacked
[0],
583 format_desc
->block
.width
, format_desc
->block
.height
);
586 for (i
= 0; i
< format_desc
->block
.bits
/8; ++i
)
587 if ((test
->packed
[i
] & test
->mask
[i
]) != (packed
[i
] & test
->mask
[i
]))
591 print_packed(format_desc
, "FAILED: ", packed
, " obtained\n");
592 print_packed(format_desc
, " ", test
->packed
, " expected\n");
600 test_format_unpack_s_8uint(const struct util_format_description
*format_desc
,
601 const struct util_format_test_case
*test
)
603 uint8_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
] = { { 0 } };
604 uint8_t expected
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
] = { { 0 } };
608 format_desc
->unpack_s_8uint(&unpacked
[0][0], sizeof unpacked
[0],
610 format_desc
->block
.width
, format_desc
->block
.height
);
612 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
613 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
614 expected
[i
][j
] = test
->unpacked
[i
][j
][1];
619 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
620 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
621 if (expected
[i
][j
] != unpacked
[i
][j
]) {
628 print_unpacked_s_8uint(format_desc
, "FAILED: ", unpacked
, " obtained\n");
629 print_unpacked_s_8uint(format_desc
, " ", expected
, " expected\n");
637 test_format_pack_s_8uint(const struct util_format_description
*format_desc
,
638 const struct util_format_test_case
*test
)
640 uint8_t unpacked
[UTIL_FORMAT_MAX_UNPACKED_HEIGHT
][UTIL_FORMAT_MAX_UNPACKED_WIDTH
];
641 uint8_t packed
[UTIL_FORMAT_MAX_PACKED_BYTES
];
645 for (i
= 0; i
< format_desc
->block
.height
; ++i
) {
646 for (j
= 0; j
< format_desc
->block
.width
; ++j
) {
647 unpacked
[i
][j
] = test
->unpacked
[i
][j
][1];
648 if (test
->unpacked
[i
][j
][0]) {
654 memset(packed
, 0, sizeof packed
);
656 format_desc
->pack_s_8uint(packed
, 0,
657 &unpacked
[0][0], sizeof unpacked
[0],
658 format_desc
->block
.width
, format_desc
->block
.height
);
661 for (i
= 0; i
< format_desc
->block
.bits
/8; ++i
)
662 if ((test
->packed
[i
] & test
->mask
[i
]) != (packed
[i
] & test
->mask
[i
]))
666 print_packed(format_desc
, "FAILED: ", packed
, " obtained\n");
667 print_packed(format_desc
, " ", test
->packed
, " expected\n");
674 /* Touch-test that the unorm/snorm flags are set up right by codegen. */
676 test_format_norm_flags(const struct util_format_description
*format_desc
)
678 boolean success
= TRUE
;
680 #define FORMAT_CASE(format, unorm, snorm) \
682 success = (format_desc->is_unorm == unorm && \
683 format_desc->is_snorm == snorm); \
686 switch (format_desc
->format
) {
687 FORMAT_CASE(PIPE_FORMAT_R8G8B8A8_UNORM
, TRUE
, FALSE
);
688 FORMAT_CASE(PIPE_FORMAT_R8G8B8A8_SRGB
, TRUE
, FALSE
);
689 FORMAT_CASE(PIPE_FORMAT_R8G8B8A8_SNORM
, FALSE
, TRUE
);
690 FORMAT_CASE(PIPE_FORMAT_R32_FLOAT
, FALSE
, FALSE
);
691 FORMAT_CASE(PIPE_FORMAT_X8Z24_UNORM
, TRUE
, FALSE
);
692 FORMAT_CASE(PIPE_FORMAT_S8X24_UINT
, FALSE
, FALSE
);
693 FORMAT_CASE(PIPE_FORMAT_DXT1_RGB
, TRUE
, FALSE
);
694 FORMAT_CASE(PIPE_FORMAT_ETC2_RGB8
, TRUE
, FALSE
);
695 FORMAT_CASE(PIPE_FORMAT_ETC2_R11_SNORM
, FALSE
, TRUE
);
696 FORMAT_CASE(PIPE_FORMAT_ASTC_4x4
, TRUE
, FALSE
);
697 FORMAT_CASE(PIPE_FORMAT_BPTC_RGBA_UNORM
, TRUE
, FALSE
);
698 FORMAT_CASE(PIPE_FORMAT_BPTC_RGB_FLOAT
, FALSE
, FALSE
);
700 success
= !(format_desc
->is_unorm
&& format_desc
->is_snorm
);
706 printf("FAILED: %s (unorm %s, snorm %s)\n",
707 format_desc
->short_name
,
708 format_desc
->is_unorm
? "yes" : "no",
709 format_desc
->is_snorm
? "yes" : "no");
716 (*test_func_t
)(const struct util_format_description
*format_desc
,
717 const struct util_format_test_case
*test
);
721 test_one_func(const struct util_format_description
*format_desc
,
726 boolean success
= TRUE
;
728 printf("Testing util_format_%s_%s ...\n",
729 format_desc
->short_name
, suffix
);
732 for (i
= 0; i
< util_format_nr_test_cases
; ++i
) {
733 const struct util_format_test_case
*test
= &util_format_test_cases
[i
];
735 if (test
->format
== format_desc
->format
) {
736 if (!func(format_desc
, &util_format_test_cases
[i
])) {
746 test_format_metadata(const struct util_format_description
*format_desc
,
747 boolean (*func
)(const struct util_format_description
*format_desc
),
750 boolean success
= TRUE
;
752 printf("Testing util_format_%s_%s ...\n", format_desc
->short_name
, suffix
);
755 if (!func(format_desc
)) {
765 enum pipe_format format
;
766 boolean success
= TRUE
;
768 for (format
= 1; format
< PIPE_FORMAT_COUNT
; ++format
) {
769 const struct util_format_description
*format_desc
;
771 format_desc
= util_format_description(format
);
776 assert(format_desc
->block
.bits
<= UTIL_FORMAT_MAX_PACKED_BYTES
* 8);
777 assert(format_desc
->block
.height
<= UTIL_FORMAT_MAX_UNPACKED_HEIGHT
);
778 assert(format_desc
->block
.width
<= UTIL_FORMAT_MAX_UNPACKED_WIDTH
);
780 # define TEST_ONE_FUNC(name) \
781 if (format_desc->name) { \
782 if (!test_one_func(format_desc, &test_format_##name, #name)) { \
787 # define TEST_FORMAT_METADATA(name) \
788 if (!test_format_metadata(format_desc, &test_format_##name, #name)) { \
792 TEST_ONE_FUNC(fetch_rgba_float);
793 TEST_ONE_FUNC(pack_rgba_float
);
794 TEST_ONE_FUNC(unpack_rgba
);
795 TEST_ONE_FUNC(pack_rgba_8unorm
);
796 TEST_ONE_FUNC(unpack_rgba_8unorm
);
798 TEST_ONE_FUNC(unpack_z_32unorm
);
799 TEST_ONE_FUNC(pack_z_32unorm
);
800 TEST_ONE_FUNC(unpack_z_float
);
801 TEST_ONE_FUNC(pack_z_float
);
802 TEST_ONE_FUNC(unpack_s_8uint
);
803 TEST_ONE_FUNC(pack_s_8uint
);
805 TEST_FORMAT_METADATA(norm_flags
);
807 # undef TEST_ONE_FUNC
808 # undef TEST_ONE_FORMAT
815 int main(int argc
, char **argv
)
819 success
= test_all();
821 return success
? 0 : 1;