[Mesa-dev] [PATCH 1/3] radeonsi: assert that the DB format is valid

Marek Olšák maraeo at gmail.com
Thu Nov 15 10:14:20 PST 2012


On Thu, Nov 15, 2012 at 5:28 PM, Christian König
<deathsimple at vodafone.de> wrote:
> On 15.11.2012 17:00, alexdeucher at gmail.com wrote:
>>
>> From: Alex Deucher <alexander.deucher at amd.com>
>>
>> Rather than disabling the depth buffer.
>
> I would still prefer to use *_INVALID as the invalid function return value
> here.
>
> Just imagine a release build with an undetected bug, writing *_INVALID would
> still result in well defined hw behavior, while ~0 usually maps to something
> reserved. Of course additionally asserting on it still makes allot of sense.

How about #define INVALID_FORMAT ~0? Using the hardware "INVALID"
format means the buffer binding is *disabled*, not *invalid*, so there
should be a distinction between disabled buffers (unbound) and invalid
ones (bound with an unsupported format, we should never happen).

If you're concerned about a release build, I guess we can just abort()
if the format translation fails and there is no way to report the
failure to the state tracker. I just think it's a serious bug and if
it happens, we shouldn't hide it.

Marek


More information about the mesa-dev mailing list