wined3d: universal surface convertor function for unsigned integer color formats(5th attempt)
ErV2005 at rambler.ru
Wed Jul 30 12:47:47 CDT 2008
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.
> Michael Karcher
Fine, I've fixed that and resubmitted patch. But now conversion will be
Виктор Ерёмин (ErV2005 at rambler.ru)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 489 bytes
Desc: This is a digitally signed message part.
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20080730/e2c89d30/attachment.pgp
More information about the wine-devel