On Wed 31 May 2017, Jason Ekstrand wrote:
> On May 31, 2017 9:32:23 PM Ian Romanick <i...@freedesktop.org> wrote:
> 
> > Having the unsupported format value not be zero isn't very safe.  The
> > C99 rules say that any field missing an initializer is implicitly
> > initialized to zero.  If a MESA_FORMAT_ value is added but is not added
> > to the array initializer, we'll have this same problem... but in a way
> > that is much harder to detect.
> 
> Good point.  Chad, how would you feel about leaving things zero and then
> having a loop that walks the array, knows about the one special case, and
> sets all unsupported things to ISL_FORMAT_UNSUPPORTED?  Then we get the best
> of both worlds.

My patch is garbage. We all agree.

I prefer Matt's approach that preserves the array's static constness. If
that doesn't work, then I'll write a loop. I'll reply back after testing
it.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to