[Mesa-dev] [PATCH v3 17/24] mesa: Add non-normalized formats support for ubyte packing functions

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Dec 15 03:31:09 PST 2014


On Thursday, December 11, 2014 11:54:39 AM Jason Ekstrand wrote:
> Let's squash this in to patch 14.
> 

OK.

Sam

> On Tue, Dec 9, 2014 at 4:07 AM, Iago Toral Quiroga <itoral at igalia.com>
> 
> wrote:
> > From: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> > 
> > v2:
> > - Add clamping for non-normalized integer formats in pack_ubyte*()
> > 
> > Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> > ---
> > 
> >  src/mesa/main/format_pack.py | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/mesa/main/format_pack.py b/src/mesa/main/format_pack.py
> > index a65a614..afb5011 100644
> > --- a/src/mesa/main/format_pack.py
> > +++ b/src/mesa/main/format_pack.py
> > @@ -88,7 +88,13 @@ pack_ubyte_${f.short_name()}(const GLubyte src[4], void
> > *dst)
> > 
> >        %endif
> >        
> >        ${c.datatype()} ${c.name} =
> > 
> > -      %if c.type == parser.UNSIGNED:
> > +      %if not f.is_normalized() and f.is_int():
> > +          %if c.type == parser.SIGNED:
> > +              _mesa_unsigned_to_signed(src[${i}], ${c.size});
> > +          %else:
> > +              _mesa_unsigned_to_unsigned(src[${i}], ${c.size});
> > +          %endif
> > 
> > +      %elif c.type == parser.UNSIGNED:
> >           %if f.colorspace == 'srgb' and c.name in 'rgb':
> >              util_format_linear_to_srgb_8unorm(src[${i}]);
> >           
> >           %else:
> > --
> > 1.9.1
> > 
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141215/0a0da207/attachment.sig>


More information about the mesa-dev mailing list