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

Brian Paul brianp at vmware.com
Wed Oct 28 19:14:51 PDT 2015


On 10/28/2015 12:55 PM, Ilia Mirkin wrote:
> 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;
>   	}
>   }
>
>

Looks good to me.  Plus, it allows llvmpipe to pass with my 
arb_copy_image changes.

-Brian



More information about the Piglit mailing list