<p dir="ltr"><br>
On Sep 16, 2014 6:54 PM, "Dave Airlie" <<a href="mailto:airlied@gmail.com">airlied@gmail.com</a>> wrote:<br>
><br>
> On 17 September 2014 09:56, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> > Got a couple comments below.  Other than that,<br>
> > Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
> ><br>
> > On Mon, Sep 15, 2014 at 11:28 PM, Dave Airlie <<a href="mailto:airlied@gmail.com">airlied@gmail.com</a>> wrote:<br>
> >><br>
> >> From: Richard Sandiford <<a href="mailto:rsandifo@linux.vnet.ibm.com">rsandifo@linux.vnet.ibm.com</a>><br>
> >><br>
> >> This means that each 8888 SRGB format has a reversed counterpart,<br>
> >> which is necessary for handling big-endian mesa<->gallium mappings.<br>
> >><br>
> >> Signed-off-by: Richard Sandiford <<a href="mailto:rsandifo@linux.vnet.ibm.com">rsandifo@linux.vnet.ibm.com</a>><br>
> >> Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
> >> ---<br>
> >>  src/mesa/drivers/dri/i965/brw_surface_formats.c |  1 +<br>
> >>  src/mesa/main/format_pack.c                     | 60<br>
> >> +++++++++++++++++++++++++<br>
> >>  src/mesa/main/format_unpack.c                   | 42 +++++++++++++++++<br>
> >>  src/mesa/main/formats.c                         | 16 +++++++<br>
> >>  src/mesa/main/formats.csv                       |  3 ++<br>
> >>  src/mesa/main/formats.h                         |  3 ++<br>
> >>  src/mesa/main/texformat.c                       | 10 +++++<br>
> >>  src/mesa/swrast/s_texfetch.c                    |  3 ++<br>
> >>  src/mesa/swrast/s_texfetch_tmp.h                | 24 ++++++++++<br>
> >>  9 files changed, 162 insertions(+)<br>
> >><br>
> >> diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c<br>
> >> b/src/mesa/drivers/dri/i965/brw_surface_formats.c<br>
> >> index b726c27..21b8adb 100644<br>
> >> --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c<br>
> >> +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c<br>
> >> @@ -517,6 +517,7 @@ brw_format_for_mesa_format(mesa_format mesa_format)<br>
> >>        [MESA_FORMAT_B5G5R5X1_UNORM] = BRW_SURFACEFORMAT_B5G5R5X1_UNORM,<br>
> >>        [MESA_FORMAT_R8G8B8X8_SNORM] = 0,<br>
> >>        [MESA_FORMAT_R8G8B8X8_SRGB] = 0,<br>
> >> +      [MESA_FORMAT_X8B8G8R8_SRGB] = 0,<br>
> ><br>
> ><br>
> > Any particular reason you go out of your way to add X8B8G8R8_SRGB and not<br>
> > the other two?<br>
><br>
> no good one, I'll fix that up.<br>
><br>
> >> +static void<br>
> >> +pack_float_X8B8G8R8_SRGB(const GLfloat src[4], void *dst)<br>
> >> +{<br>
> >> +   GLuint *d = (GLuint *) dst;<br>
> >> +   GLubyte r = util_format_linear_float_to_srgb_8unorm(src[RCOMP]);<br>
> >> +   GLubyte g = util_format_linear_float_to_srgb_8unorm(src[GCOMP]);<br>
> >> +   GLubyte b = util_format_linear_float_to_srgb_8unorm(src[BCOMP]);<br>
> >> +   *d = PACK_COLOR_8888(r, g, b, 127);<br>
> ><br>
> ><br>
> > That should be a max of 255, these aren't SNORM formats<br>
><br>
> These two are taken from equivalent code in<br>
> pack_float_B8G8R8X8_SRGB<br>
><br>
> that is currently in mesa, so I should send a patch to fix those up as well?</p>
<p dir="ltr">Yes, unless I'm going crazy. (Which is always a possibility.)<br>
--Jason </p>
<p dir="ltr">><br>
> Thanks,<br>
> Dave.<br>
</p>