Jump to content
  • Advertisement
Sign in to follow this  

Reversing DXT endianess

This topic is 2880 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to write a DXT compressed image (just DXT1 for now) so that it can be read on a big endian system (XBox 360) and I seem to be having some problems.

I know the block structure contains two 16-bit RGB colors followed by a 4x4 2-bit lookup table. I'm assuming I'm supposed to reverse the byte order of the two colors, but I'm not sure what I'm supposed to do with the table. Do I leave it alone, swap every pair of two bytes, swap all four bytes as if it were a 32-bit integer? I've tried just about every variation I can think of, but I'm not getting correct results so I just wanted to see if anyone knows correct procedure (which I may or may not have already tried and somehow gotten wrong).


EDIT: Looks like reversing every 2 byte pair did the trick. Not sure why it didn't seem to be working at first, may have been testing stale data.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!