[Mesa-dev] Mesa (master): translate_generic: return NULL instead of assert(0) if format not supported

Luca Barbieri luca at luca-barbieri.com
Wed Aug 11 09:20:05 PDT 2010


> Assert failures mean something that developers didn't anticipate to
> happen did happen. But release code should still continue past the
> assert and do something sensible like ignoring. That is, it should be
> resilient against the unexpected. At least this is my perspective.

Note however that this means you will have hard to debug silent
misrenderings, instead of an easy to debug crash or assert.

Most code using translate works because it specifies an output format
that is known to be supported.
This seems to be definitely the case for code outside r300g, while I'm
not totally sure whether r300g's usage of translate is broken or not.
I suspect it isn't since they would have noticed that in debug builds.

If you really want to keep the current behavior, I think I could just
add an ugly list of supported formats to the test program, so that it
avoids to test unsupported ones, although it doesn't seem a great
thing.


More information about the mesa-dev mailing list