i965: Replace 0 with ISL_FORMAT_UNSUPPORTED in format table (v2)
authorChad Versace <chadversary@chromium.org>
Sat, 27 May 2017 01:48:28 +0000 (18:48 -0700)
committerChad Versace <chadversary@chromium.org>
Fri, 2 Jun 2017 19:41:30 +0000 (12:41 -0700)
commite9f5004d5ea38a21019e0affcd63d353b98d499a
treea2d9954dcd9bf3baace28362f08e370f06ffe076
parent1fec0498503ca8f4ebb96dc2cb712893eaaa281b
i965: Replace 0 with ISL_FORMAT_UNSUPPORTED in format table (v2)

When given an *unsupported* mesa_format,
brw_isl_format_for_mesa_format() returned 0, a *valid* isl_format,
ISL_FORMAT_R32G32B32A32_FLOAT.  The problem is that
brw_isl_format_for_mesa_format's inner table used 0 instead of
ISL_FORMAT_UNSUPPORTED to indicate unsupported mesa formats.

Some callers of brw_isl_format_for_mesa_format() were aware of this
weirdness, and worked around it. This patch removes those workarounds.

v2: Ensure that all array elements are initialized to
  ISL_FORMAT_UNSUPPORTED, even when new formats are added to enum
  mesa_format, by using an designated range initializer.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_surface_formats.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c