*helps if I send to the list*
Maybe I don't understand what you're saying.
ok atm, the code for texsubimage2d_bgr888_to_rgba8888 looks partially like this
#define DST_TEXELS_PER_DWORD 1 #define CONVERT_TEXEL( dst, src ) \ dst = PACK_COLOR_8888_LE( src[0], src[1], src[2], 0xff )
#define CONVERT_TEXEL_DWORD( dst, src ) CONVERT_TEXEL( dst, src )
#define SRC_TEXEL_BYTES 3
...
{ const GLint texels = convert->width * convert->height; const GLint dwords = texels / DST_TEXELS_PER_DWORD; const GLint leftover = texels - dwords * DST_TEXELS_PER_DWORD; GLint i; for ( i = 0 ; i < dwords ; i++ ) { CONVERT_TEXEL_DWORD( *dst++, src ); src += SRC_TEXEL_BYTES * DST_TEXELS_PER_DWORD; } for ( i = 0; i < leftover; i++ ) { CONVERT_TEXEL( *dst++, src ); src += SRC_TEXEL_BYTES; } }
----------------
looking at this, from a bgr888 -> rgba8888 perspecitve (and correct me if I'm wrong) this would be better as
{ const GLint texels = convert->width * convert->height; for (i = texels; i; i--) { CONVERT_TEXEL( *dst++, src ); src += SRC_TEXEL_BYTES; } }
Just my observation.
Yes, lefover is always 0 in this case so we could simplify that. Care to send a patch? Otherwise, I'll get to it later.
-Brian
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click -- _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel