From: Eric Anholt Date: Mon, 19 Aug 2019 21:24:12 +0000 (-0700) Subject: gallium: Add an equivalent of MESA_FORMAT_BGR_UNORM8. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6fab4a7b59d566269437c88798ae4c811136b927;p=mesa.git gallium: Add an equivalent of MESA_FORMAT_BGR_UNORM8. This is the last unorm format that MESA_FORMAT had and PIPE_FORMAT didn't. Note that it's an array format on gallium's side as well, since it's a NPOT pixel size. Reviewed-by: Marek Olšák --- diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 2f67e7e80ea..02f20cf1cb2 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -339,6 +339,7 @@ PIPE_FORMAT_R16G16B16A16_SSCALED , plain, 1, 1, 1, s16 , s16 , s16 , s16 , xy PIPE_FORMAT_R8_UNORM , plain, 1, 1, 1, un8 , , , , x001, rgb PIPE_FORMAT_R8G8_UNORM , plain, 1, 1, 1, un8 , un8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_UNORM , plain, 1, 1, 1, un8 , un8 , un8 , , xyz1, rgb +PIPE_FORMAT_B8G8R8_UNORM , plain, 1, 1, 1, un8 , un8 , un8 , , zyx1, rgb PIPE_FORMAT_R8G8B8A8_UNORM , plain, 1, 1, 1, un8 , un8 , un8 , un8 , xyzw, rgb PIPE_FORMAT_R8_USCALED , plain, 1, 1, 1, u8 , , , , x001, rgb PIPE_FORMAT_R8G8_USCALED , plain, 1, 1, 1, u8 , u8 , , , xy01, rgb diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index f1524352d9e..fa104e1d66c 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -108,6 +108,7 @@ enum pipe_format { PIPE_FORMAT_R8_UNORM, PIPE_FORMAT_R8G8_UNORM, PIPE_FORMAT_R8G8B8_UNORM, + PIPE_FORMAT_B8G8R8_UNORM, PIPE_FORMAT_R8G8B8A8_UNORM, PIPE_FORMAT_X8B8G8R8_UNORM, PIPE_FORMAT_R8_USCALED, diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index e60ac10ac4f..1d6b439681c 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -234,6 +234,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st, return PIPE_FORMAT_R8G8_UNORM; case MESA_FORMAT_RG_UNORM16: return PIPE_FORMAT_R16G16_UNORM; + case MESA_FORMAT_BGR_UNORM8: + return PIPE_FORMAT_B8G8R8_UNORM; case MESA_FORMAT_RGBA_UNORM16: return PIPE_FORMAT_R16G16B16A16_UNORM; @@ -847,6 +849,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_RG_UNORM8; case PIPE_FORMAT_R16G16_UNORM: return MESA_FORMAT_RG_UNORM16; + case PIPE_FORMAT_B8G8R8_UNORM: + return MESA_FORMAT_BGR_UNORM8; case PIPE_FORMAT_A8_UINT: return MESA_FORMAT_A_UINT8;