Sign in to follow this  

Reversing DXT endianess

This topic is 2542 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).

Thanks!

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

This topic is 2542 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this