[Mesa-dev] rgtc signed format and u_format: some open questions

Brian Paul brianp at vmware.com
Thu Mar 3 15:58:54 PST 2011

On 03/03/2011 02:40 PM, Dave Airlie wrote:
> On Fri, Mar 4, 2011 at 8:17 AM, Jose Fonseca<jfonseca at vmware.com>  wrote:
>> About a), one day we should have this in a library shared by mesa/gallium, but until then anywhere is fine by me.
>> About b) please provide unorm8 support for all formats. It's useful for debugging/displaying, e.g., writing to BMP files, or visualizing on a window. There is already a helper function called util_format_fits_rgba8unorm (or something like that) to determine whether a format can be faithfully represented in unorm8 or not.
> I don't understand how it can be useful though, if I have an image
> internally represented at -128..127, and I dump it as unorm 0.255 it
> is going to actually me less useful I would guess as I'd try and
> interpret it. Though I've no idea what negative color looks like, the
> hooks are pretty easy to add in, but I'd like to add something to warn
> if they ever get used.

You could either clamp the signed values to [0,127] or bias them by 
128 I guess.  It's not a huge deal.


More information about the mesa-dev mailing list