/*
* Mesa 3-D graphics library
- * Version: 6.5.2
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
default:
_mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n * comps);
- }
}
break;
case GL_SHORT:
default:
_mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n * comps );
- }
}
break;
case GL_UNSIGNED_INT:
default:
_mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n * comps );
- }
}
break;
case GL_INT:
default:
_mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n * comps );
- }
}
break;
case GL_FLOAT:
default:
_mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
- if (dstPacking->SwapBytes) {
- _mesa_swap4( (GLuint *) dst, n * comps );
- }
}
break;
case GL_HALF_FLOAT_ARB:
default:
_mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
- if (dstPacking->SwapBytes) {
- _mesa_swap2( (GLushort *) dst, n * comps );
- }
}
break;
case GL_UNSIGNED_BYTE_3_3_2:
break;
default:
_mesa_problem(ctx, "bad type in _mesa_pack_rgba_span_float");
+ return;
+ }
+
+ if (dstPacking->SwapBytes) {
+ GLint swapSize = _mesa_sizeof_packed_type(dstType);
+ if (swapSize == 2) {
+ if (dstPacking->SwapBytes) {
+ _mesa_swap2((GLushort *) dstAddr, n * comps);
+ }
+ }
+ else if (swapSize == 4) {
+ if (dstPacking->SwapBytes) {
+ _mesa_swap4((GLuint *) dstAddr, n * comps);
+ }
+ }
}
}