From 10adb7840c3a37dedc940fe593b246336eebd71e Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Wed, 11 Aug 2010 21:19:12 +0200 Subject: translate: allow clients to ask for supported output formats Currently translate asserts on unsupported output formats, making it impossible to use for some purposes, such as testing whether it actually works on all formats it supports. Removing the assert was met with opposition, so this change allows clients to ask whether an output format is supported, and they are thus able to avoid attempting to use it. Since this is just an addition to the API, no adverse effect is possible, and it makes the testsuite work again. --- src/gallium/auxiliary/translate/translate.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/auxiliary/translate/translate.h') diff --git a/src/gallium/auxiliary/translate/translate.h b/src/gallium/auxiliary/translate/translate.h index edd95e0788..eb6f2cc486 100644 --- a/src/gallium/auxiliary/translate/translate.h +++ b/src/gallium/auxiliary/translate/translate.h @@ -105,6 +105,8 @@ struct translate *translate_lookup_or_create( struct translate_context *tctx, struct translate *translate_create( const struct translate_key *key ); +boolean translate_is_output_format_supported(enum pipe_format format); + static INLINE int translate_keysize( const struct translate_key *key ) { return 2 * sizeof(int) + key->nr_elements * sizeof(struct translate_element); @@ -138,5 +140,6 @@ struct translate *translate_sse2_create( const struct translate_key *key ); struct translate *translate_generic_create( const struct translate_key *key ); +boolean translate_generic_is_output_format_supported(enum pipe_format format); #endif -- cgit v1.2.3