[Mesa-dev] [Bug 84566] Unify the format conversion code

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Oct 15 02:31:04 PDT 2014


--- Comment #19 from Iago Toral <itoral at igalia.com> ---
Jason, for conversions where we cannot use a fast path in the master converter
(that is, where we need to unpack the src to rgba and then pack from rgba to
dst) you differentiate between 3 paths: uint (integer), float (is_signed ||
bits > 8) and ubyte (otherwise).

While the last two paths seem to be always valid (I think we have pack and
unpack functions for all relevant formats for these types), I am hitting an
assertion in the first path because there are no uint unpack functions for some
types. Indeed, _mesa_unpack_uint_rgba_row only supports unpacking from a
limited set of uint formats. I am hitting this path in cases where dst is an
integer type but src is not. The code will choose the integer even though the
implementation requires that both src and dst are integer, since we need an
uint unpack function for the src in this case.

A solution for this would be to forget about the uint path and always go with
the float path or the ubyte path, but I imagine that the uint path has benefits
when it can be used... I guess because we could avoid uint->{float,byte}

So, I think we have two options:
1) Auto-generate uint unpack/pack functions for all required mesa formats.
2) Only use the integer path if both src and dst are integer types.

I think 1) is only useful when src is not an integer type (so we would be doing
a type conversion anyway), so maybe 2) is the most sensible approach in this
case. What do you think?

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141015/22accb02/attachment.html>

More information about the mesa-dev mailing list