[Mesa-dev] [PATCH mesa] gallium: simplify util_format_is_supported()

Matt Turner mattst88 at gmail.com
Mon Jun 18 14:31:49 UTC 2018


On Mon, Jun 18, 2018 at 3:15 AM Eric Engestrom <eric.engestrom at intel.com> wrote:
>
> As of 66673bef941af344314f ("mesa: Unconditionally enable floating-point
> textures"), the `bind` argument is no longer used, and the format check
> is now a simple enum range check, so inline it and remove the
> unnecessary argument from callers.
>
> Cc: Timothy Arceri <tarceri at itsqueeze.com>
> Cc: Matt Turner <mattst88 at gmail.com>
> Cc: Ian Romanick <ian.d.romanick at intel.com>
> Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> ---
>  src/gallium/auxiliary/util/u_format.c           | 12 ------------
>  src/gallium/auxiliary/util/u_format.h           |  7 +++++--
>  src/gallium/drivers/freedreno/a2xx/fd2_screen.c |  2 +-
>  src/gallium/drivers/freedreno/a3xx/fd3_screen.c |  2 +-
>  src/gallium/drivers/freedreno/a4xx/fd4_screen.c |  2 +-
>  src/gallium/drivers/freedreno/a5xx/fd5_screen.c |  2 +-
>  src/gallium/drivers/i915/i915_screen.c          |  2 +-
>  src/gallium/drivers/nouveau/nv30/nv30_screen.c  |  2 +-
>  src/gallium/drivers/nouveau/nv50/nv50_screen.c  |  2 +-
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c  |  2 +-
>  src/gallium/drivers/r300/r300_screen.c          |  2 +-
>  src/gallium/drivers/r600/evergreen_state.c      |  2 +-
>  src/gallium/drivers/r600/r600_state.c           |  2 +-
>  src/gallium/drivers/radeonsi/si_state.c         |  2 +-
>  src/gallium/drivers/v3d/v3d_screen.c            |  2 +-
>  src/gallium/drivers/vc4/vc4_screen.c            |  2 +-
>  16 files changed, 19 insertions(+), 28 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c
> index e0325e9c534974b15c65..d82d00a9d06fde2daeef 100644
> --- a/src/gallium/auxiliary/util/u_format.c
> +++ b/src/gallium/auxiliary/util/u_format.c
> @@ -235,18 +235,6 @@ util_format_is_subsampled_422(enum pipe_format format)
>        desc->block.bits == 32;
>  }
>
> -boolean
> -util_format_is_supported(enum pipe_format format, unsigned bind)
> -{
> -   if (format >= PIPE_FORMAT_COUNT) {
> -      return FALSE;
> -   }
> -
> -   (void)bind;
> -
> -   return TRUE;
> -}
> -
>
>  /**
>   * Calculates the MRD for the depth format. MRD is used in depth bias
> diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
> index e497b4b3375a57771009..9c5df967b6c01288d0b3 100644
> --- a/src/gallium/auxiliary/util/u_format.h
> +++ b/src/gallium/auxiliary/util/u_format.h
> @@ -721,8 +721,11 @@ util_is_format_compatible(const struct util_format_description *src_desc,
>   * Whether the format is supported by Gallium for the given bindings.
>   * This covers S3TC textures and floating-point render targets.

I suspect this line was here because these two things might not be
available. But now they are :)

I think this line should be removed.

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list