<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#c22">Comment # 22</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#c20">comment #20</a>)
<span class="quote">> (In reply to Iago Toral from <a href="show_bug.cgi?id=84566#c18">comment #18</a>)
> > (In reply to Jason Ekstrand from <a href="show_bug.cgi?id=84566#c17">comment #17</a>)
> > > (In reply to Iago Toral from <a href="show_bug.cgi?id=84566#c16">comment #16</a>)
> > > > We also need new mesa_format enums and pack/unpack functions for byte
> > > > swapped variants of non-array types.
> > >
> > > Why? Is this for the byte_swapped flag on GL upload/downloads? If that's
> > > the only reason, then I'd rather not bother adding mesa types. We can
> > > easily do a byte swap with _mesa_swizzle_and_convert. While it's a little
> > > bit of a performance hit, people shouldn't be using that attribute anyway.
> >
> > I think that won't help in this case. We can only use
> > _mesa_swizzle_and_convert for array types, but as I say, this involves
> > non-array types like GL_UNSIGNED_INT_10_10_10_2. The master converter will
> > not use _mesa_swizzle_and_convert with these, it goes through things like
> > _mesa_unpack_rgba_row and _mesa_pack_float_rgba_row for example (which rely
> > on auto-generated pack/unpack functions). Do you think we should try expand
> > these to consider byte-swapping?
>
> My inclination on byte-swapping it to keep it out of the master conversion
> function. It's really an oddity of the old GL api and not a core format
> conversion thing. No sanely written app should use byte swapping, so I'm
> not too worried about making it fast. My inclination there is to keep going
> byteswapping and the other format conversion ops in TexImage, GetTexImag,
> ReadPixels, and DrawPixels. They can call _mesa_swizzle_and_convert to do
> the byteswap operation befor calling into the actual format conversion
> function.</span >
I'll try it this way then.
<span class="quote">> The downside here is that there are a few cases where we can do better.
> However, that's pretty much limited to GL_UNSIGNED_INT_8_8_8_8[_REV] and I
> don't think it's worth the effort.</span >
I am already handling GL_UNSIGNED_INT_8_8_8_8[_REV] with byte swapping when we
generate the mesa_array_format from the gl format and type.(it is only a matter
of reverting the component mapping in this case), so if we want we can have
TexImage and cia handle byte-swapping for all formats but this one.</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>