<p dir="ltr"><br>
On Jan 14, 2015 5:16 AM, "Iago Toral Quiroga" <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br>
><br>
> Hi Tapani,<br>
><br>
> thanks for looking into this one, I certainly missed that extension...<br>
><br>
> On mié, 2015-01-14 at 14:04 +0200, Tapani Pälli wrote:<br>
> > Commit 8ec6534 changed texture upload path and the way how texture<br>
> > format is being checked, this commit adds support for GL_RGB with<br>
> > GL_UNSIGNED_INT_2_10_10_10_REV as specified by the extension<br>
> > EXT_texture_type_2_10_10_10_REV specification.<br>
><br>
> The extension mentions that when this is used with RGB, the alpha<br>
> channel assumes a value 1.0 when expanded...<br>
><br>
> > This fixes regression in ES3 conformance test<br>
> >    ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels<br>
> ><br>
> > Signed-off-by: Tapani Pälli <<a href="mailto:tapani.palli@intel.com">tapani.palli@intel.com</a>><br>
> > Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=88385">https://bugs.freedesktop.org/show_bug.cgi?id=88385</a><br>
> > ---<br>
> >  src/mesa/main/glformats.c | 3 ++-<br>
> >  1 file changed, 2 insertions(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c<br>
> > index 3e913edme.e54bb90 100644<br>
> > --- a/src/mesa/main/glformats.c<br>
> > +++ b/src/mesa/main/glformats.c<br>
> > @@ -2666,7 +2666,8 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)<br>
> >           return MESA_FORMAT_A2R10G10B10_UINT;<br>
> >        break;<br>
> >     case GL_UNSIGNED_INT_2_10_10_10_REV:<br>
> > -      if (format == GL_RGBA)<br>
> > +      if (format == GL_RGB || /* GL_EXT_texture_type_2_10_10_10_REV */<br>
> > +          format == GL_RGBA)<br>
> >           return MESA_FORMAT_R10G10B10A2_UNORM;<br>
><br>
> ...so I think this is not correct: with this we will lose track that<br>
> this was RGB data and we will not ensure A=1.0 if this is stored as<br>
> RGBA.<br>
><br>
> I think what we want to do here is add a new mesa_format like<br>
> MESA_FORMAT_R10G10B10X2_UNORM, so we can use auto-generated pack/unpack<br>
> functions that take care of this. We would add that enum to formats.h,<br>
> then add the type description to formats.csv and then return that enum<br>
> here for the RGB case.<br>
><br>
> Jason, what do you think?</p>
<p dir="ltr">Seems reasonable to me.<br>
--Jason</p>
<p dir="ltr">> >        else if (format == GL_RGBA_INTEGER)<br>
> >           return MESA_FORMAT_R10G10B10A2_UINT;<br>
><br>
><br>
</p>