<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#c34">Comment # 34</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:jason@jlekstrand.net" title="Jason Ekstrand <jason@jlekstrand.net>"> <span class="fn">Jason Ekstrand</span></a>
</span></b>
<pre>(In reply to Samuel Iglesias from <a href="show_bug.cgi?id=84566#c33">comment #33</a>)
<span class="quote">> 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 true.
>
> 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?</span >
Supporting clamping is probably fine. I think we determined we needed a clamp
parameter anyway for some of the float conversions. I guess it makes sense for
integers too. Let's watch out for performance when we implement it though.
Changing the loop inside mesa_swizzle_and_convert without hurting performance
can be tricky. The teximage-colors test in Piglit has a -benchmark flag that
can be used for testing that.</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>