<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Unify the format conversion code"
href="https://bugs.freedesktop.org/show_bug.cgi?id=84566#c12">Comment # 12</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Unify the format conversion code"
href="https://bugs.freedesktop.org/show_bug.cgi?id=84566">bug 84566</a>
from <span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span></b>
<pre>(In reply to Jason Ekstrand from <a href="show_bug.cgi?id=84566#c11">comment #11</a>)
<span class="quote">> (In reply to Iago Toral from <a href="show_bug.cgi?id=84566#c10">comment #10</a>)
> > (In reply to Iago Toral from <a href="show_bug.cgi?id=84566#c9">comment #9</a>)
> > > Jason, piglit tests hit cases where they attempt to convert GL format and
> > > data type combinations that do not match any of the existing mesa formats.
> > >
> > > For example GL_RGB + GL_UNSIGNED_BYTE_2_3_3_REV (BBGG GRRR). The Only mesa
> > > format of this kind is MESA_FORMAT_B2G3R3_UNORM (RRRG GGBB).
> > >
> > > This means that we don't have pack and unpack functions for these types,
> > > which we need to use a master conversion function. I think the natural thing
> > > to do would be to add new mesa_format types for these, together with their
> > > format_pack.c and format_unpack.c functions (which should be auto-generated
> > > too). I suppose it is okay to add new mesa_format enums, right?
> >
> > BTW, as an added bonus, with this approach we will speed up conversion for
> > some of these types too. For example, the way Mesa currently handles
> > GL_UNSIGNED_BYTE_2_3_3_REV to GL_RGBA UBYTE involves two conversions
> > (2_3_3_REV -> RGBA FLOAT -> RGBA_UBYTE), while we would be able to do that
> > in one go via the auto-generated unpack function.
>
> How many formats like this are there? If it's only a few, then it probably
> makes sense to add the few mesa_formats that we need.</span >
I don't know yet. For that I would have enable the master convertion function
for all code paths, then run all the piglit tests and then check the cases that
hit the assertion I have one by one removing duplicate cases, so it would take
some time.
In any case, even if these were a significant bunch: do we have a good
alternative? If we don't create mesa_formats for these types we would have to
handle them as exceptions to the process (and this kind of defeats the purpose
of a master function). We would have to handle conversions from and to these
types through different paths and write the conversions functions we need by
hand...</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>