[Mesa-dev] [PATCH 4/6] i965: Replace 0 with ISL_FORMAT_UNSUPPORTED in format table

Ian Romanick idr at freedesktop.org
Thu Jun 1 04:31:48 UTC 2017


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.

On 05/31/2017 04:43 PM, Chad Versace wrote:
> 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.
> ---
>  src/mesa/drivers/dri/i965/brw_surface_formats.c  | 168 +++++++++++------------
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c |   2 +-
>  2 files changed, 84 insertions(+), 86 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
> index 52d3acb..8fd9ae5 100644
> --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
> +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
> @@ -38,29 +38,29 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
>      */
>     static const uint32_t table[MESA_FORMAT_COUNT] =
>     {
> -      [MESA_FORMAT_A8B8G8R8_UNORM] = 0,
> +      [MESA_FORMAT_A8B8G8R8_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_R8G8B8A8_UNORM] = ISL_FORMAT_R8G8B8A8_UNORM,
>        [MESA_FORMAT_B8G8R8A8_UNORM] = ISL_FORMAT_B8G8R8A8_UNORM,
> -      [MESA_FORMAT_A8R8G8B8_UNORM] = 0,
> -      [MESA_FORMAT_X8B8G8R8_UNORM] = 0,
> +      [MESA_FORMAT_A8R8G8B8_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_X8B8G8R8_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_R8G8B8X8_UNORM] = ISL_FORMAT_R8G8B8X8_UNORM,
>        [MESA_FORMAT_B8G8R8X8_UNORM] = ISL_FORMAT_B8G8R8X8_UNORM,
> -      [MESA_FORMAT_X8R8G8B8_UNORM] = 0,
> -      [MESA_FORMAT_BGR_UNORM8] = 0,
> +      [MESA_FORMAT_X8R8G8B8_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_BGR_UNORM8] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_RGB_UNORM8] = ISL_FORMAT_R8G8B8_UNORM,
>        [MESA_FORMAT_B5G6R5_UNORM] = ISL_FORMAT_B5G6R5_UNORM,
> -      [MESA_FORMAT_R5G6B5_UNORM] = 0,
> +      [MESA_FORMAT_R5G6B5_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_B4G4R4A4_UNORM] = ISL_FORMAT_B4G4R4A4_UNORM,
> -      [MESA_FORMAT_A4R4G4B4_UNORM] = 0,
> -      [MESA_FORMAT_A1B5G5R5_UNORM] = 0,
> +      [MESA_FORMAT_A4R4G4B4_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A1B5G5R5_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_B5G5R5A1_UNORM] = ISL_FORMAT_B5G5R5A1_UNORM,
> -      [MESA_FORMAT_A1R5G5B5_UNORM] = 0,
> -      [MESA_FORMAT_L4A4_UNORM] = 0,
> +      [MESA_FORMAT_A1R5G5B5_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L4A4_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_L8A8_UNORM] = ISL_FORMAT_L8A8_UNORM,
> -      [MESA_FORMAT_A8L8_UNORM] = 0,
> +      [MESA_FORMAT_A8L8_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_L16A16_UNORM] = ISL_FORMAT_L16A16_UNORM,
> -      [MESA_FORMAT_A16L16_UNORM] = 0,
> -      [MESA_FORMAT_B2G3R3_UNORM] = 0,
> +      [MESA_FORMAT_A16L16_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_B2G3R3_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_A_UNORM8] = ISL_FORMAT_A8_UNORM,
>        [MESA_FORMAT_A_UNORM16] = ISL_FORMAT_A16_UNORM,
>        [MESA_FORMAT_L_UNORM8] = ISL_FORMAT_L8_UNORM,
> @@ -71,29 +71,29 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
>        [MESA_FORMAT_YCBCR] = ISL_FORMAT_YCRCB_SWAPUVY,
>        [MESA_FORMAT_R_UNORM8] = ISL_FORMAT_R8_UNORM,
>        [MESA_FORMAT_R8G8_UNORM] = ISL_FORMAT_R8G8_UNORM,
> -      [MESA_FORMAT_G8R8_UNORM] = 0,
> +      [MESA_FORMAT_G8R8_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_R_UNORM16] = ISL_FORMAT_R16_UNORM,
>        [MESA_FORMAT_R16G16_UNORM] = ISL_FORMAT_R16G16_UNORM,
> -      [MESA_FORMAT_G16R16_UNORM] = 0,
> +      [MESA_FORMAT_G16R16_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_B10G10R10A2_UNORM] = ISL_FORMAT_B10G10R10A2_UNORM,
> -      [MESA_FORMAT_S8_UINT_Z24_UNORM] = 0,
> -      [MESA_FORMAT_Z24_UNORM_S8_UINT] = 0,
> -      [MESA_FORMAT_Z_UNORM16] = 0,
> -      [MESA_FORMAT_Z24_UNORM_X8_UINT] = 0,
> -      [MESA_FORMAT_X8_UINT_Z24_UNORM] = 0,
> -      [MESA_FORMAT_Z_UNORM32] = 0,
> +      [MESA_FORMAT_S8_UINT_Z24_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_Z24_UNORM_S8_UINT] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_Z_UNORM16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_Z24_UNORM_X8_UINT] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_X8_UINT_Z24_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_Z_UNORM32] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_S_UINT8] = ISL_FORMAT_R8_UINT,
>  
> -      [MESA_FORMAT_BGR_SRGB8] = 0,
> -      [MESA_FORMAT_A8B8G8R8_SRGB] = 0,
> +      [MESA_FORMAT_BGR_SRGB8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A8B8G8R8_SRGB] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_B8G8R8A8_SRGB] = ISL_FORMAT_B8G8R8A8_UNORM_SRGB,
> -      [MESA_FORMAT_A8R8G8B8_SRGB] = 0,
> +      [MESA_FORMAT_A8R8G8B8_SRGB] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_R8G8B8A8_SRGB] = ISL_FORMAT_R8G8B8A8_UNORM_SRGB,
> -      [MESA_FORMAT_X8R8G8B8_SRGB] = 0,
> +      [MESA_FORMAT_X8R8G8B8_SRGB] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_B8G8R8X8_SRGB] = ISL_FORMAT_B8G8R8X8_UNORM_SRGB,
>        [MESA_FORMAT_L_SRGB8] = ISL_FORMAT_L8_UNORM_SRGB,
>        [MESA_FORMAT_L8A8_SRGB] = ISL_FORMAT_L8A8_UNORM_SRGB,
> -      [MESA_FORMAT_A8L8_SRGB] = 0,
> +      [MESA_FORMAT_A8L8_SRGB] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_SRGB_DXT1] = ISL_FORMAT_BC1_UNORM_SRGB,
>        [MESA_FORMAT_SRGBA_DXT1] = ISL_FORMAT_BC1_UNORM_SRGB,
>        [MESA_FORMAT_SRGBA_DXT3] = ISL_FORMAT_BC2_UNORM_SRGB,
> @@ -109,7 +109,7 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
>        [MESA_FORMAT_RGBA_FLOAT32] = ISL_FORMAT_R32G32B32A32_FLOAT,
>        [MESA_FORMAT_RGBA_FLOAT16] = ISL_FORMAT_R16G16B16A16_FLOAT,
>        [MESA_FORMAT_RGB_FLOAT32] = ISL_FORMAT_R32G32B32_FLOAT,
> -      [MESA_FORMAT_RGB_FLOAT16] = 0,
> +      [MESA_FORMAT_RGB_FLOAT16] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_A_FLOAT32] = ISL_FORMAT_A32_FLOAT,
>        [MESA_FORMAT_A_FLOAT16] = ISL_FORMAT_A16_FLOAT,
>        [MESA_FORMAT_L_FLOAT32] = ISL_FORMAT_L32_FLOAT,
> @@ -123,33 +123,33 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
>        [MESA_FORMAT_RG_FLOAT32] = ISL_FORMAT_R32G32_FLOAT,
>        [MESA_FORMAT_RG_FLOAT16] = ISL_FORMAT_R16G16_FLOAT,
>  
> -      [MESA_FORMAT_A_UINT8] = 0,
> -      [MESA_FORMAT_A_UINT16] = 0,
> -      [MESA_FORMAT_A_UINT32] = 0,
> -      [MESA_FORMAT_A_SINT8] = 0,
> -      [MESA_FORMAT_A_SINT16] = 0,
> -      [MESA_FORMAT_A_SINT32] = 0,
> -
> -      [MESA_FORMAT_I_UINT8] = 0,
> -      [MESA_FORMAT_I_UINT16] = 0,
> -      [MESA_FORMAT_I_UINT32] = 0,
> -      [MESA_FORMAT_I_SINT8] = 0,
> -      [MESA_FORMAT_I_SINT16] = 0,
> -      [MESA_FORMAT_I_SINT32] = 0,
> -
> -      [MESA_FORMAT_L_UINT8] = 0,
> -      [MESA_FORMAT_L_UINT16] = 0,
> -      [MESA_FORMAT_L_UINT32] = 0,
> -      [MESA_FORMAT_L_SINT8] = 0,
> -      [MESA_FORMAT_L_SINT16] = 0,
> -      [MESA_FORMAT_L_SINT32] = 0,
> -
> -      [MESA_FORMAT_LA_UINT8] = 0,
> -      [MESA_FORMAT_LA_UINT16] = 0,
> -      [MESA_FORMAT_LA_UINT32] = 0,
> -      [MESA_FORMAT_LA_SINT8] = 0,
> -      [MESA_FORMAT_LA_SINT16] = 0,
> -      [MESA_FORMAT_LA_SINT32] = 0,
> +      [MESA_FORMAT_A_UINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A_UINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A_UINT32] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A_SINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A_SINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A_SINT32] = ISL_FORMAT_UNSUPPORTED,
> +
> +      [MESA_FORMAT_I_UINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_I_UINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_I_UINT32] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_I_SINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_I_SINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_I_SINT32] = ISL_FORMAT_UNSUPPORTED,
> +
> +      [MESA_FORMAT_L_UINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_UINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_UINT32] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_SINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_SINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_SINT32] = ISL_FORMAT_UNSUPPORTED,
> +
> +      [MESA_FORMAT_LA_UINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_UINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_UINT32] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_SINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_SINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_SINT32] = ISL_FORMAT_UNSUPPORTED,
>  
>        [MESA_FORMAT_R_SINT8] = ISL_FORMAT_R8_SINT,
>        [MESA_FORMAT_RG_SINT8] = ISL_FORMAT_R8G8_SINT,
> @@ -179,8 +179,8 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
>  
>        [MESA_FORMAT_R_SNORM8] = ISL_FORMAT_R8_SNORM,
>        [MESA_FORMAT_R8G8_SNORM] = ISL_FORMAT_R8G8_SNORM,
> -      [MESA_FORMAT_X8B8G8R8_SNORM] = 0,
> -      [MESA_FORMAT_A8B8G8R8_SNORM] = 0,
> +      [MESA_FORMAT_X8B8G8R8_SNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A8B8G8R8_SNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_R8G8B8A8_SNORM] = ISL_FORMAT_R8G8B8A8_SNORM,
>        [MESA_FORMAT_R_SNORM16] = ISL_FORMAT_R16_SNORM,
>        [MESA_FORMAT_R16G16_SNORM] = ISL_FORMAT_R16G16_SNORM,
> @@ -193,10 +193,10 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
>        [MESA_FORMAT_RG_RGTC2_UNORM] = ISL_FORMAT_BC5_UNORM,
>        [MESA_FORMAT_RG_RGTC2_SNORM] = ISL_FORMAT_BC5_SNORM,
>  
> -      [MESA_FORMAT_L_LATC1_UNORM] = 0,
> -      [MESA_FORMAT_L_LATC1_SNORM] = 0,
> -      [MESA_FORMAT_LA_LATC2_UNORM] = 0,
> -      [MESA_FORMAT_LA_LATC2_SNORM] = 0,
> +      [MESA_FORMAT_L_LATC1_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_LATC1_SNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_LATC2_UNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_LATC2_SNORM] = ISL_FORMAT_UNSUPPORTED,
>  
>        [MESA_FORMAT_ETC1_RGB8] = ISL_FORMAT_ETC1_RGB8,
>        [MESA_FORMAT_ETC2_RGB8] = ISL_FORMAT_ETC2_RGB8,
> @@ -244,43 +244,44 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
>        [MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x10] = ISL_FORMAT_ASTC_LDR_2D_12X10_U8SRGB,
>        [MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12] = ISL_FORMAT_ASTC_LDR_2D_12X12_U8SRGB,
>  
> -      [MESA_FORMAT_A_SNORM8] = 0,
> -      [MESA_FORMAT_L_SNORM8] = 0,
> -      [MESA_FORMAT_L8A8_SNORM] = 0,
> -      [MESA_FORMAT_A8L8_SNORM] = 0,
> -      [MESA_FORMAT_I_SNORM8] = 0,
> -      [MESA_FORMAT_A_SNORM16] = 0,
> -      [MESA_FORMAT_L_SNORM16] = 0,
> -      [MESA_FORMAT_LA_SNORM16] = 0,
> -      [MESA_FORMAT_I_SNORM16] = 0,
> +      [MESA_FORMAT_A_SNORM8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_SNORM8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L8A8_SNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A8L8_SNORM] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_I_SNORM8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_A_SNORM16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_L_SNORM16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_LA_SNORM16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_I_SNORM16] = ISL_FORMAT_UNSUPPORTED,
>  
>        [MESA_FORMAT_R9G9B9E5_FLOAT] = ISL_FORMAT_R9G9B9E5_SHAREDEXP,
>        [MESA_FORMAT_R11G11B10_FLOAT] = ISL_FORMAT_R11G11B10_FLOAT,
>  
> -      [MESA_FORMAT_Z_FLOAT32] = 0,
> -      [MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = 0,
> +      [MESA_FORMAT_Z_FLOAT32] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = ISL_FORMAT_UNSUPPORTED,
>  
>        [MESA_FORMAT_R10G10B10A2_UNORM] = ISL_FORMAT_R10G10B10A2_UNORM,
>        [MESA_FORMAT_B10G10R10A2_UINT] = ISL_FORMAT_B10G10R10A2_UINT,
>        [MESA_FORMAT_R10G10B10A2_UINT] = ISL_FORMAT_R10G10B10A2_UINT,
>  
> -      [MESA_FORMAT_B4G4R4X4_UNORM] = 0,
> +      [MESA_FORMAT_B4G4R4X4_UNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_B5G5R5X1_UNORM] = ISL_FORMAT_B5G5R5X1_UNORM,
> -      [MESA_FORMAT_R8G8B8X8_SNORM] = 0,
> +      [MESA_FORMAT_R8G8B8X8_SNORM] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_R8G8B8X8_SRGB] = ISL_FORMAT_R8G8B8X8_UNORM_SRGB,
> -      [MESA_FORMAT_X8B8G8R8_SRGB] = 0,
> -      [MESA_FORMAT_RGBX_UINT8] = 0,
> -      [MESA_FORMAT_RGBX_SINT8] = 0,
> +      [MESA_FORMAT_X8B8G8R8_SRGB] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_RGBX_UINT8] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_RGBX_SINT8] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_B10G10R10X2_UNORM] = ISL_FORMAT_B10G10R10X2_UNORM,
>        [MESA_FORMAT_RGBX_UNORM16] = ISL_FORMAT_R16G16B16X16_UNORM,
> -      [MESA_FORMAT_RGBX_SNORM16] = 0,
> +      [MESA_FORMAT_RGBX_SNORM16] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_RGBX_FLOAT16] = ISL_FORMAT_R16G16B16X16_FLOAT,
> -      [MESA_FORMAT_RGBX_UINT16] = 0,
> -      [MESA_FORMAT_RGBX_SINT16] = 0,
> +      [MESA_FORMAT_RGBX_UINT16] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_RGBX_SINT16] = ISL_FORMAT_UNSUPPORTED,
>        [MESA_FORMAT_RGBX_FLOAT32] = ISL_FORMAT_R32G32B32X32_FLOAT,
> -      [MESA_FORMAT_RGBX_UINT32] = 0,
> -      [MESA_FORMAT_RGBX_SINT32] = 0,
> +      [MESA_FORMAT_RGBX_UINT32] = ISL_FORMAT_UNSUPPORTED,
> +      [MESA_FORMAT_RGBX_SINT32] = ISL_FORMAT_UNSUPPORTED,
>     };
> +
>     assert(mesa_format < MESA_FORMAT_COUNT);
>     return table[mesa_format];
>  }
> @@ -305,10 +306,7 @@ brw_init_surface_formats(struct brw_context *brw)
>  
>        render = texture = brw_isl_format_for_mesa_format(format);
>  
> -      /* The value of ISL_FORMAT_R32G32B32A32_FLOAT is 0, so don't skip
> -       * it.
> -       */
> -      if (texture == 0 && format != MESA_FORMAT_RGBA_FLOAT32)
> +      if (texture == ISL_FORMAT_UNSUPPORTED)
>  	 continue;
>  
>        /* Don't advertise 8 and 16-bit RGB formats to core mesa.  This ensures
> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> index de6fd8d..502bf37 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -712,7 +712,7 @@ brw_update_buffer_texture_surface(struct gl_context *ctx,
>      */
>     size = MIN2(size, ctx->Const.MaxTextureBufferSize * (unsigned) texel_size);
>  
> -   if (isl_format == 0 && format != MESA_FORMAT_RGBA_FLOAT32) {
> +   if (isl_format == ISL_FORMAT_UNSUPPORTED) {
>        _mesa_problem(NULL, "bad format %s for texture buffer\n",
>  		    _mesa_get_format_name(format));
>     }
> 



More information about the mesa-dev mailing list