Sunday, March 18, 2012

Migrating to 64 bits

Sooner or later you'll find at the crossroads of deciding whether or not switch to 64 bit. If you want to be future proof, do it!

Migrating our engine to 64 bit has been quite the ride. Here are some tips and recommendations:

* Make a new configuration off your 32 bit one. Then change the code generation to be x64.
* Temporarily remove all 3rd party libs linking with your project, and #ifdef the code that uses it out with some define. This is usually the most boring part; the goal here is to be able to compile/link first. We'll fix the runtime issues later.
* Once your solution links & compiles, try to run it for kick's sake. And start fixing the errors as you go.
* If you load binary data directly off disk, you'll have to work on each tool that generates binary data and make it work for 64 bit (or gasp! Both 32 & 64 bit!)
* The biggest issue we found during our conversion was pointers and padding. I'll discuss that in another post.
* You might be able to live with having 32 bit tools that generate 64 bit data. The usual problem with this is if you have a struct/class which you write out directly to disk, but there are ways around this.

No comments: