[Piglit] [PATCH] arb_copy_image: if formats different, make sure they can be reinterpreted

Ilia Mirkin imirkin at alum.mit.edu
Wed Oct 28 11:55:33 PDT 2015


This prevents the test from trying to copy compressed formats to depth
textures and vice-versa.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 tests/spec/arb_copy_image/formats.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_copy_image/formats.c b/tests/spec/arb_copy_image/formats.c
index 8aa3658..a4c027e 100644
--- a/tests/spec/arb_copy_image/formats.c
+++ b/tests/spec/arb_copy_image/formats.c
@@ -273,6 +273,9 @@ are_formats_compatible(struct texture_format *f1, struct texture_format *f2)
 	if (f1 == f2)
 		return true;
 
+	if (!f1->can_be_reinterpreted || !f2->can_be_reinterpreted)
+		return false;
+
 	if (is_format_compressed(f1)) {
 		if (is_format_compressed(f2))
 			/* Compressed-to-compressed copies are not supported */
@@ -282,8 +285,7 @@ are_formats_compatible(struct texture_format *f1, struct texture_format *f2)
 	} else if (is_format_compressed(f2)) {
 		return f1->bytes == f2->bytes;
 	} else {
-		return f1->can_be_reinterpreted && f2->can_be_reinterpreted &&
-		       f1->bytes == f2->bytes;
+		return f1->bytes == f2->bytes;
 	}
 }
 
-- 
2.4.10



More information about the Piglit mailing list