[Mesa-dev] [PATCH 13/14] swr: remove formats from mapping table that don't have StoreTile impls

Ilia Mirkin imirkin at alum.mit.edu
Tue Nov 15 04:38:05 UTC 2016


All formats are supported by the gallivm texturing logic (except some
compressed ones). Swr backend only needs to know about the format for
rendering, not texturing. Makes sense to me just list the renderable ones
here.

If you want a reminder of which formats could be renderable but aren't, how
about leaving all those in a comment?

Either way, the most important change is to remove all the l/la/i swr
format enums (I.e. make the function return -1) since they only have load,
not store implementations. If you still disagree with the above reasoning,
I'll redo that bit of the series.

On Nov 14, 2016 8:47 PM, "Cherniak, Bruce" <bruce.cherniak at intel.com> wrote:

> This table lists all supported formats (both renderable and texturable).
>
> swr_texture_layout calls mesa_to_swr_format to convert the PIPE_FORMAT_*
> to the appropriate SWR_FORMAT enum.  Removing these entries would result in
> -1 (unsupported format).  We might need to add a “is_renderable” field to
> the table for its use in swr_is_format_supported, but I believe these
> formats should remain.
>
> Although, it looks like you highlighted another bug, swr_texture_layout
> should return false with an early test for mesa_to_swr_format(fmt), rather
> than continuing on.
>
>
> > On Nov 12, 2016, at 5:00 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> >
> > This table exists for the purpose of determining renderable formats.
> > Without a StoreTile implementation, that can't happen.
> >
> > This basically removes rendering support to all L/LA/I formats. They can
> > be re-added when/if StoreTile implementations are added.
> >
> > Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> > ---
> > src/gallium/drivers/swr/swr_screen.cpp | 86
> +++++++++++++++++++---------------
> > 1 file changed, 48 insertions(+), 38 deletions(-)
> >
> > diff --git a/src/gallium/drivers/swr/swr_screen.cpp
> b/src/gallium/drivers/swr/swr_screen.cpp
> > index 98f5e44..9e80e94 100644
> > --- a/src/gallium/drivers/swr/swr_screen.cpp
> > +++ b/src/gallium/drivers/swr/swr_screen.cpp
> > @@ -427,12 +427,7 @@ mesa_to_swr_format(enum pipe_format format)
> >       {PIPE_FORMAT_B4G4R4A4_UNORM,         B4G4R4A4_UNORM},
> >       {PIPE_FORMAT_B5G6R5_UNORM,           B5G6R5_UNORM},
> >       {PIPE_FORMAT_R10G10B10A2_UNORM,      R10G10B10A2_UNORM},
> > -      {PIPE_FORMAT_L8_UNORM,               L8_UNORM},
> >       {PIPE_FORMAT_A8_UNORM,               A8_UNORM},
> > -      {PIPE_FORMAT_I8_UNORM,               I8_UNORM},
> > -      {PIPE_FORMAT_L8A8_UNORM,             L8A8_UNORM},
> > -      {PIPE_FORMAT_L16_UNORM,              L16_UNORM},
> > -      {PIPE_FORMAT_UYVY,                   YCRCB_SWAPUVY},
> >       {PIPE_FORMAT_Z16_UNORM,              R16_UNORM}, // z
> >       {PIPE_FORMAT_Z32_FLOAT,              R32_FLOAT}, // z
> >       {PIPE_FORMAT_Z24_UNORM_S8_UINT,      R24_UNORM_X8_TYPELESS}, // z
> > @@ -486,26 +481,11 @@ mesa_to_swr_format(enum pipe_format format)
> >       {PIPE_FORMAT_R16G16B16_FLOAT,        R16G16B16_FLOAT},
> >       {PIPE_FORMAT_R16G16B16A16_FLOAT,     R16G16B16A16_FLOAT},
> >
> > -      {PIPE_FORMAT_L8_SRGB,                L8_UNORM_SRGB},
> > -      {PIPE_FORMAT_L8A8_SRGB,              L8A8_UNORM_SRGB},
> >       {PIPE_FORMAT_R8G8B8_SRGB,            R8G8B8_UNORM_SRGB},
> >       {PIPE_FORMAT_B8G8R8A8_SRGB,          B8G8R8A8_UNORM_SRGB},
> >       {PIPE_FORMAT_B8G8R8X8_SRGB,          B8G8R8X8_UNORM_SRGB},
> >       {PIPE_FORMAT_R8G8B8A8_SRGB,          R8G8B8A8_UNORM_SRGB},
> >
> > -      {PIPE_FORMAT_DXT1_RGBA,              BC1_UNORM},
> > -      {PIPE_FORMAT_DXT3_RGBA,              BC2_UNORM},
> > -      {PIPE_FORMAT_DXT5_RGBA,              BC3_UNORM},
> > -
> > -      {PIPE_FORMAT_DXT1_SRGBA,             BC1_UNORM_SRGB},
> > -      {PIPE_FORMAT_DXT3_SRGBA,             BC2_UNORM_SRGB},
> > -      {PIPE_FORMAT_DXT5_SRGBA,             BC3_UNORM_SRGB},
> > -
> > -      {PIPE_FORMAT_RGTC1_UNORM,            BC4_UNORM},
> > -      {PIPE_FORMAT_RGTC1_SNORM,            BC4_SNORM},
> > -      {PIPE_FORMAT_RGTC2_UNORM,            BC5_UNORM},
> > -      {PIPE_FORMAT_RGTC2_SNORM,            BC5_SNORM},
> > -
> >       {PIPE_FORMAT_B5G5R5X1_UNORM,         B5G5R5X1_UNORM},
> >       {PIPE_FORMAT_R10G10B10A2_USCALED,    R10G10B10A2_USCALED},
> >       {PIPE_FORMAT_R11G11B10_FLOAT,        R11G11B10_FLOAT},
> > @@ -514,18 +494,9 @@ mesa_to_swr_format(enum pipe_format format)
> >       {PIPE_FORMAT_B10G10R10A2_UNORM,      B10G10R10A2_UNORM},
> >       {PIPE_FORMAT_R8G8B8X8_UNORM,         R8G8B8X8_UNORM},
> >
> > -      {PIPE_FORMAT_L16A16_UNORM,           L16A16_UNORM},
> >       {PIPE_FORMAT_A16_UNORM,              A16_UNORM},
> > -      {PIPE_FORMAT_I16_UNORM,              I16_UNORM},
> > -
> >       {PIPE_FORMAT_A16_FLOAT,              A16_FLOAT},
> > -      {PIPE_FORMAT_L16_FLOAT,              L16_FLOAT},
> > -      {PIPE_FORMAT_L16A16_FLOAT,           L16A16_FLOAT},
> > -      {PIPE_FORMAT_I16_FLOAT,              I16_FLOAT},
> >       {PIPE_FORMAT_A32_FLOAT,              A32_FLOAT},
> > -      {PIPE_FORMAT_L32_FLOAT,              L32_FLOAT},
> > -      {PIPE_FORMAT_L32A32_FLOAT,           L32A32_FLOAT},
> > -      {PIPE_FORMAT_I32_FLOAT,              I32_FLOAT},
> >
> >       {PIPE_FORMAT_R10G10B10A2_SSCALED,    R10G10B10A2_SSCALED},
> >       {PIPE_FORMAT_R10G10B10A2_SNORM,      R10G10B10A2_SNORM},
> > @@ -564,14 +535,6 @@ mesa_to_swr_format(enum pipe_format format)
> >       {PIPE_FORMAT_R32G32B32_SINT,         R32G32B32_SINT},
> >       {PIPE_FORMAT_R32G32B32A32_SINT,      R32G32B32A32_SINT},
> >
> > -      {PIPE_FORMAT_I8_UINT,                I8_UINT},
> > -      {PIPE_FORMAT_L8_UINT,                L8_UINT},
> > -      {PIPE_FORMAT_L8A8_UINT,              L8A8_UINT},
> > -
> > -      {PIPE_FORMAT_I8_SINT,                I8_SINT},
> > -      {PIPE_FORMAT_L8_SINT,                L8_SINT},
> > -      {PIPE_FORMAT_L8A8_SINT,              L8A8_SINT},
> > -
> >       {PIPE_FORMAT_B10G10R10A2_UINT,       B10G10R10A2_UINT},
> >
> >       {PIPE_FORMAT_B10G10R10X2_UNORM,      B10G10R10X2_UNORM},
> > @@ -580,7 +543,54 @@ mesa_to_swr_format(enum pipe_format format)
> >       {PIPE_FORMAT_R32G32B32X32_FLOAT,     R32G32B32X32_FLOAT},
> >       {PIPE_FORMAT_R10G10B10A2_UINT,       R10G10B10A2_UINT},
> >
> > -      {PIPE_FORMAT_B5G6R5_SRGB,            B5G6R5_UNORM_SRGB}
> > +      {PIPE_FORMAT_B5G6R5_SRGB,            B5G6R5_UNORM_SRGB},
> > +
> > +      /* These formats have entries in SWR but don't have Load/StoreTile
> > +       * implementations. That means these aren't renderable, and thus
> having
> > +       * a mapping entry here is detrimental.
> > +       */
> > +      /*
> > +
> > +      {PIPE_FORMAT_L8_UNORM,               L8_UNORM},
> > +      {PIPE_FORMAT_I8_UNORM,               I8_UNORM},
> > +      {PIPE_FORMAT_L8A8_UNORM,             L8A8_UNORM},
> > +      {PIPE_FORMAT_L16_UNORM,              L16_UNORM},
> > +      {PIPE_FORMAT_UYVY,                   YCRCB_SWAPUVY},
> > +
> > +      {PIPE_FORMAT_L8_SRGB,                L8_UNORM_SRGB},
> > +      {PIPE_FORMAT_L8A8_SRGB,              L8A8_UNORM_SRGB},
> > +
> > +      {PIPE_FORMAT_DXT1_RGBA,              BC1_UNORM},
> > +      {PIPE_FORMAT_DXT3_RGBA,              BC2_UNORM},
> > +      {PIPE_FORMAT_DXT5_RGBA,              BC3_UNORM},
> > +
> > +      {PIPE_FORMAT_DXT1_SRGBA,             BC1_UNORM_SRGB},
> > +      {PIPE_FORMAT_DXT3_SRGBA,             BC2_UNORM_SRGB},
> > +      {PIPE_FORMAT_DXT5_SRGBA,             BC3_UNORM_SRGB},
> > +
> > +      {PIPE_FORMAT_RGTC1_UNORM,            BC4_UNORM},
> > +      {PIPE_FORMAT_RGTC1_SNORM,            BC4_SNORM},
> > +      {PIPE_FORMAT_RGTC2_UNORM,            BC5_UNORM},
> > +      {PIPE_FORMAT_RGTC2_SNORM,            BC5_SNORM},
> > +
> > +      {PIPE_FORMAT_L16A16_UNORM,           L16A16_UNORM},
> > +      {PIPE_FORMAT_I16_UNORM,              I16_UNORM},
> > +      {PIPE_FORMAT_L16_FLOAT,              L16_FLOAT},
> > +      {PIPE_FORMAT_L16A16_FLOAT,           L16A16_FLOAT},
> > +      {PIPE_FORMAT_I16_FLOAT,              I16_FLOAT},
> > +      {PIPE_FORMAT_L32_FLOAT,              L32_FLOAT},
> > +      {PIPE_FORMAT_L32A32_FLOAT,           L32A32_FLOAT},
> > +      {PIPE_FORMAT_I32_FLOAT,              I32_FLOAT},
> > +
> > +      {PIPE_FORMAT_I8_UINT,                I8_UINT},
> > +      {PIPE_FORMAT_L8_UINT,                L8_UINT},
> > +      {PIPE_FORMAT_L8A8_UINT,              L8A8_UINT},
> > +
> > +      {PIPE_FORMAT_I8_SINT,                I8_SINT},
> > +      {PIPE_FORMAT_L8_SINT,                L8_SINT},
> > +      {PIPE_FORMAT_L8A8_SINT,              L8A8_SINT},
> > +
> > +      */
> >    };
> >
> >    try {
> > --
> > 2.7.3
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161114/ef52b9be/attachment-0001.html>


More information about the mesa-dev mailing list