[PATCH 1/2] d3dx9: Implement converting and copying ARGB surface data in D3DXLoadSurfaceFromMemory

Tony Wasserka tony.wasserka at freenet.de
Tue Oct 13 07:13:43 CDT 2009


Many changes since the last try, for example:
- Merged FORMAT_ARGB and FORMAT_ABGR, the important thing was that they
did /not/ need any signedness conversion
- grouped all "component variables" into arrays, i.e. abits, rbits,
gbits, bbits into a single bits[4] array. Improves readability, makes
the code more compact and might allow the compiler to optimize the code
yet a bit more.
- Passing PixelFormatDesc /pointers/ now instead of copies
- modified copy_simple_data to be more flexible, it will be able to
handle many other kinds of different data (big ARGB formats, DXT
compression, QWVU formats, etc) now.
- the "for(shift = destshift[i]; shift > destformat->shift[i]; shift -=
srcformat->bits[i]) *pixel |= channels[i] << shift;" loop might not be
pretty, but it was the only way from my testing which produced close
results to native behavior WITHOUT using floats. floats reduced
performance severely. The way it's done know is fast enough and differs
by only ~5 (out of 255) per component to the native behavior (at
maximum, that is. Things are matching quite well most times though)
- various other optimizations, for example the new process_channel array.



More information about the wine-patches mailing list