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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 20 23:37:14 PDT 2014


--- Comment #33 from Samuel Iglesias <siglesias at igalia.com> ---
Jason, I would like to know your opinion about the integer RGBA clamping done
in pack.c (_mesa_pack_rgba_span_from_ints()).

glReadPixels() and glGetTexImage() specs said (for example, in OpenGL 3.3. core
specification) that for an integer RGBA color, each component is clamped to the
representable range of type.

Those GL functions end up calling pack.c's functions for performing the
conversion (mesa_pack_rgba_span_from_ints() and others).

It's possible to replace some of those pack.c's conversion functions by the
master conversion but the problem is in the clamping operation. I would like to
add a boolean argument called "clamp" to the master conversion function which
is passed to _mesa_swizzle_and_convert() where each of its
convert_{uint,int,byte,ubyte,short,ushort}() do the right thing when "clamp" is

This "clamp" parameter would be false for every call to either master
conversion function or _mesa_swizzle_and_convert() except when they are being
called from pack.c.

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/20141021/27957f67/attachment.html>

More information about the mesa-dev mailing list