<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">You’re absolutely correct, the gallivm sampler supports all formats regardless of our table.  I stand corrected.</div>
<div class=""><br class="">
</div>
<div class="">Reviewed-by: Bruce Cherniak <<a href="mailto:bruce.cherniak@intel.com" class="">bruce.cherniak@intel.com</a>> </div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 14, 2016, at 10:38 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<p dir="ltr" class="">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.</p>
<p dir="ltr" class="">If you want a reminder of which formats could be renderable but aren't, how about leaving all those in a comment?</p>
<p dir="ltr" class="">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.</p>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Nov 14, 2016 8:47 PM, "Cherniak, Bruce" <<a href="mailto:bruce.cherniak@intel.com" class="">bruce.cherniak@intel.com</a>> wrote:<br type="attribution" class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This table lists all supported formats (both renderable and texturable).<br class="">
<br class="">
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.<br class="">
<br class="">
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.<br class="">
<br class="">
<br class="">
> On Nov 12, 2016, at 5:00 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:<br class="">
><br class="">
> This table exists for the purpose of determining renderable formats.<br class="">
> Without a StoreTile implementation, that can't happen.<br class="">
><br class="">
> This basically removes rendering support to all L/LA/I formats. They can<br class="">
> be re-added when/if StoreTile implementations are added.<br class="">
><br class="">
> Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>><br class="">
> ---<br class="">
> src/gallium/drivers/swr/swr_<wbr class="">screen.cpp | 86 +++++++++++++++++++-----------<wbr class="">----<br class="">
> 1 file changed, 48 insertions(+), 38 deletions(-)<br class="">
><br class="">
> diff --git a/src/gallium/drivers/swr/swr_<wbr class="">screen.cpp b/src/gallium/drivers/swr/swr_<wbr class="">screen.cpp<br class="">
> index 98f5e44..9e80e94 100644<br class="">
> --- a/src/gallium/drivers/swr/swr_<wbr class="">screen.cpp<br class="">
> +++ b/src/gallium/drivers/swr/swr_<wbr class="">screen.cpp<br class="">
> @@ -427,12 +427,7 @@ mesa_to_swr_format(enum pipe_format format)<br class="">
>       {PIPE_FORMAT_B4G4R4A4_UNORM,         B4G4R4A4_UNORM},<br class="">
>       {PIPE_FORMAT_B5G6R5_UNORM,           B5G6R5_UNORM},<br class="">
>       {PIPE_FORMAT_R10G10B10A2_<wbr class="">UNORM,      R10G10B10A2_UNORM},<br class="">
> -      {PIPE_FORMAT_L8_UNORM,               L8_UNORM},<br class="">
>       {PIPE_FORMAT_A8_UNORM,               A8_UNORM},<br class="">
> -      {PIPE_FORMAT_I8_UNORM,               I8_UNORM},<br class="">
> -      {PIPE_FORMAT_L8A8_UNORM,             L8A8_UNORM},<br class="">
> -      {PIPE_FORMAT_L16_UNORM,              L16_UNORM},<br class="">
> -      {PIPE_FORMAT_UYVY,                   YCRCB_SWAPUVY},<br class="">
>       {PIPE_FORMAT_Z16_UNORM,              R16_UNORM}, // z<br class="">
>       {PIPE_FORMAT_Z32_FLOAT,              R32_FLOAT}, // z<br class="">
>       {PIPE_FORMAT_Z24_UNORM_S8_<wbr class="">UINT,      R24_UNORM_X8_TYPELESS}, // z<br class="">
> @@ -486,26 +481,11 @@ mesa_to_swr_format(enum pipe_format format)<br class="">
>       {PIPE_FORMAT_R16G16B16_FLOAT,        R16G16B16_FLOAT},<br class="">
>       {PIPE_FORMAT_R16G16B16A16_<wbr class="">FLOAT,     R16G16B16A16_FLOAT},<br class="">
><br class="">
> -      {PIPE_FORMAT_L8_SRGB,                L8_UNORM_SRGB},<br class="">
> -      {PIPE_FORMAT_L8A8_SRGB,              L8A8_UNORM_SRGB},<br class="">
>       {PIPE_FORMAT_R8G8B8_SRGB,            R8G8B8_UNORM_SRGB},<br class="">
>       {PIPE_FORMAT_B8G8R8A8_SRGB,          B8G8R8A8_UNORM_SRGB},<br class="">
>       {PIPE_FORMAT_B8G8R8X8_SRGB,          B8G8R8X8_UNORM_SRGB},<br class="">
>       {PIPE_FORMAT_R8G8B8A8_SRGB,          R8G8B8A8_UNORM_SRGB},<br class="">
><br class="">
> -      {PIPE_FORMAT_DXT1_RGBA,              BC1_UNORM},<br class="">
> -      {PIPE_FORMAT_DXT3_RGBA,              BC2_UNORM},<br class="">
> -      {PIPE_FORMAT_DXT5_RGBA,              BC3_UNORM},<br class="">
> -<br class="">
> -      {PIPE_FORMAT_DXT1_SRGBA,             BC1_UNORM_SRGB},<br class="">
> -      {PIPE_FORMAT_DXT3_SRGBA,             BC2_UNORM_SRGB},<br class="">
> -      {PIPE_FORMAT_DXT5_SRGBA,             BC3_UNORM_SRGB},<br class="">
> -<br class="">
> -      {PIPE_FORMAT_RGTC1_UNORM,            BC4_UNORM},<br class="">
> -      {PIPE_FORMAT_RGTC1_SNORM,            BC4_SNORM},<br class="">
> -      {PIPE_FORMAT_RGTC2_UNORM,            BC5_UNORM},<br class="">
> -      {PIPE_FORMAT_RGTC2_SNORM,            BC5_SNORM},<br class="">
> -<br class="">
>       {PIPE_FORMAT_B5G5R5X1_UNORM,         B5G5R5X1_UNORM},<br class="">
>       {PIPE_FORMAT_R10G10B10A2_<wbr class="">USCALED,    R10G10B10A2_USCALED},<br class="">
>       {PIPE_FORMAT_R11G11B10_FLOAT,        R11G11B10_FLOAT},<br class="">
> @@ -514,18 +494,9 @@ mesa_to_swr_format(enum pipe_format format)<br class="">
>       {PIPE_FORMAT_B10G10R10A2_<wbr class="">UNORM,      B10G10R10A2_UNORM},<br class="">
>       {PIPE_FORMAT_R8G8B8X8_UNORM,         R8G8B8X8_UNORM},<br class="">
><br class="">
> -      {PIPE_FORMAT_L16A16_UNORM,           L16A16_UNORM},<br class="">
>       {PIPE_FORMAT_A16_UNORM,              A16_UNORM},<br class="">
> -      {PIPE_FORMAT_I16_UNORM,              I16_UNORM},<br class="">
> -<br class="">
>       {PIPE_FORMAT_A16_FLOAT,              A16_FLOAT},<br class="">
> -      {PIPE_FORMAT_L16_FLOAT,              L16_FLOAT},<br class="">
> -      {PIPE_FORMAT_L16A16_FLOAT,           L16A16_FLOAT},<br class="">
> -      {PIPE_FORMAT_I16_FLOAT,              I16_FLOAT},<br class="">
>       {PIPE_FORMAT_A32_FLOAT,              A32_FLOAT},<br class="">
> -      {PIPE_FORMAT_L32_FLOAT,              L32_FLOAT},<br class="">
> -      {PIPE_FORMAT_L32A32_FLOAT,           L32A32_FLOAT},<br class="">
> -      {PIPE_FORMAT_I32_FLOAT,              I32_FLOAT},<br class="">
><br class="">
>       {PIPE_FORMAT_R10G10B10A2_<wbr class="">SSCALED,    R10G10B10A2_SSCALED},<br class="">
>       {PIPE_FORMAT_R10G10B10A2_<wbr class="">SNORM,      R10G10B10A2_SNORM},<br class="">
> @@ -564,14 +535,6 @@ mesa_to_swr_format(enum pipe_format format)<br class="">
>       {PIPE_FORMAT_R32G32B32_SINT,         R32G32B32_SINT},<br class="">
>       {PIPE_FORMAT_R32G32B32A32_<wbr class="">SINT,      R32G32B32A32_SINT},<br class="">
><br class="">
> -      {PIPE_FORMAT_I8_UINT,                I8_UINT},<br class="">
> -      {PIPE_FORMAT_L8_UINT,                L8_UINT},<br class="">
> -      {PIPE_FORMAT_L8A8_UINT,              L8A8_UINT},<br class="">
> -<br class="">
> -      {PIPE_FORMAT_I8_SINT,                I8_SINT},<br class="">
> -      {PIPE_FORMAT_L8_SINT,                L8_SINT},<br class="">
> -      {PIPE_FORMAT_L8A8_SINT,              L8A8_SINT},<br class="">
> -<br class="">
>       {PIPE_FORMAT_B10G10R10A2_UINT,       B10G10R10A2_UINT},<br class="">
><br class="">
>       {PIPE_FORMAT_B10G10R10X2_<wbr class="">UNORM,      B10G10R10X2_UNORM},<br class="">
> @@ -580,7 +543,54 @@ mesa_to_swr_format(enum pipe_format format)<br class="">
>       {PIPE_FORMAT_R32G32B32X32_<wbr class="">FLOAT,     R32G32B32X32_FLOAT},<br class="">
>       {PIPE_FORMAT_R10G10B10A2_UINT,       R10G10B10A2_UINT},<br class="">
><br class="">
> -      {PIPE_FORMAT_B5G6R5_SRGB,            B5G6R5_UNORM_SRGB}<br class="">
> +      {PIPE_FORMAT_B5G6R5_SRGB,            B5G6R5_UNORM_SRGB},<br class="">
> +<br class="">
> +      /* These formats have entries in SWR but don't have Load/StoreTile<br class="">
> +       * implementations. That means these aren't renderable, and thus having<br class="">
> +       * a mapping entry here is detrimental.<br class="">
> +       */<br class="">
> +      /*<br class="">
> +<br class="">
> +      {PIPE_FORMAT_L8_UNORM,               L8_UNORM},<br class="">
> +      {PIPE_FORMAT_I8_UNORM,               I8_UNORM},<br class="">
> +      {PIPE_FORMAT_L8A8_UNORM,             L8A8_UNORM},<br class="">
> +      {PIPE_FORMAT_L16_UNORM,              L16_UNORM},<br class="">
> +      {PIPE_FORMAT_UYVY,                   YCRCB_SWAPUVY},<br class="">
> +<br class="">
> +      {PIPE_FORMAT_L8_SRGB,                L8_UNORM_SRGB},<br class="">
> +      {PIPE_FORMAT_L8A8_SRGB,              L8A8_UNORM_SRGB},<br class="">
> +<br class="">
> +      {PIPE_FORMAT_DXT1_RGBA,              BC1_UNORM},<br class="">
> +      {PIPE_FORMAT_DXT3_RGBA,              BC2_UNORM},<br class="">
> +      {PIPE_FORMAT_DXT5_RGBA,              BC3_UNORM},<br class="">
> +<br class="">
> +      {PIPE_FORMAT_DXT1_SRGBA,             BC1_UNORM_SRGB},<br class="">
> +      {PIPE_FORMAT_DXT3_SRGBA,             BC2_UNORM_SRGB},<br class="">
> +      {PIPE_FORMAT_DXT5_SRGBA,             BC3_UNORM_SRGB},<br class="">
> +<br class="">
> +      {PIPE_FORMAT_RGTC1_UNORM,            BC4_UNORM},<br class="">
> +      {PIPE_FORMAT_RGTC1_SNORM,            BC4_SNORM},<br class="">
> +      {PIPE_FORMAT_RGTC2_UNORM,            BC5_UNORM},<br class="">
> +      {PIPE_FORMAT_RGTC2_SNORM,            BC5_SNORM},<br class="">
> +<br class="">
> +      {PIPE_FORMAT_L16A16_UNORM,           L16A16_UNORM},<br class="">
> +      {PIPE_FORMAT_I16_UNORM,              I16_UNORM},<br class="">
> +      {PIPE_FORMAT_L16_FLOAT,              L16_FLOAT},<br class="">
> +      {PIPE_FORMAT_L16A16_FLOAT,           L16A16_FLOAT},<br class="">
> +      {PIPE_FORMAT_I16_FLOAT,              I16_FLOAT},<br class="">
> +      {PIPE_FORMAT_L32_FLOAT,              L32_FLOAT},<br class="">
> +      {PIPE_FORMAT_L32A32_FLOAT,           L32A32_FLOAT},<br class="">
> +      {PIPE_FORMAT_I32_FLOAT,              I32_FLOAT},<br class="">
> +<br class="">
> +      {PIPE_FORMAT_I8_UINT,                I8_UINT},<br class="">
> +      {PIPE_FORMAT_L8_UINT,                L8_UINT},<br class="">
> +      {PIPE_FORMAT_L8A8_UINT,              L8A8_UINT},<br class="">
> +<br class="">
> +      {PIPE_FORMAT_I8_SINT,                I8_SINT},<br class="">
> +      {PIPE_FORMAT_L8_SINT,                L8_SINT},<br class="">
> +      {PIPE_FORMAT_L8A8_SINT,              L8A8_SINT},<br class="">
> +<br class="">
> +      */<br class="">
>    };<br class="">
><br class="">
>    try {<br class="">
> --<br class="">
> 2.7.3<br class="">
><br class="">
> ______________________________<wbr class="">_________________<br class="">
> mesa-dev mailing list<br class="">
> <a href="mailto:mesa-dev@lists.freedesktop.org" class="">mesa-dev@lists.freedesktop.org</a><br class="">
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank" class="">
https://lists.freedesktop.org/<wbr class="">mailman/listinfo/mesa-dev</a><br class="">
<br class="">
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>