Advertisement
Guest User

texture swizzle

a guest
Mar 28th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. // pack 4x4 block
  2. const int lookup[] = { 5, 0, 4, 2, 1, ... }; // block sample order
  3. for (int i = 0; i < 16; ++i)
  4. {
  5.     dest[lookup[i]] = source[i];
  6. }
  7.  
  8. vs.
  9. dest[5] = source[0];
  10. dest[0] = source[1];
  11. dest[4] = source[2];
  12. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement