[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: wined3d: universal surface convertor function for unsigned
From:       Victor <ErV2005 () rambler ! ru>
Date:       2008-07-30 17:47:47
Message-ID: 200807302147.58579.ErV2005 () rambler ! ru
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Wednesday 30 July 2008 15:15:45 you wrote:
> Am Mittwoch, den 30.07.2008, 15:03 +0400 schrieb Victor:
> > > You also have to expand types properly, i.e. converting a
> > > component from 4-bit to 8-bit isn't just a shift.
> >
> > In all places where I saw pixel format conversion before, it was _always_
> > done by shifting components (even in MS-DOS vesa-based applications).
> > Your assumption that "converting isn't just a shift" requires link to
> > official documentation (i.e. proof), where it is clearly stated that
> > during Blt() (from which convert_unsigned_pixels is being called) between
> > different surface format, ddraw/d3d converts pixel format by means other
> > than simply shifting components. I doubt that in real software ddraw
> > implementation blt from 565 to 888 is done by completely recalculating
> > components using floating point operations.
>
> Floating point is overkill. The correct way for a 5 to 8 conversion is
> "divide by 31, multiply by 255". If you use
>   bits8 = bits5 << 3 | bits5 >> 2;
> you get "bits8 = bits5 * 8.25", which is always less than one off the
> correct result. What you do is to repeat the bit pattern infinitely
> instead of filling with zeroes on the right hand.
>
> Regards,
>   Michael Karcher
Fine, I've fixed that and resubmitted patch. But now conversion will be 
slower.

-- 
÷ÉËÔÏÒ åÒ£ÍÉÎ (ErV2005@rambler.ru)

["signature.asc" (application/pgp-signature)]



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic