- Open file if not already open.
- Read in a block of data (~9 MB)
- Copy to volume texture
- Render
- Repeat...
The file access is sequential and called at the end of every frame and currently I'm using the CRT file I/O stuff (fopen, fseek, fread, and fclose). And I'm wondering if there's a better way with regard to performance?
Would using memory mapped files be a good idea here? I've read conflicting statements about performance when it comes to reading a file sequentially.
I've considered loading a larger chunk of the file (i.e. multiple volume textures) in one shot, but I'm thinking that it'll hit a bottleneck when it's used up those textures and has to read in the next chunk.
Obviously, I can't read in the entire file (needs to run on 32 bit, that'd kill my process space quickly) and because of the environment I have to use (I really have no choice regarding this) I can't use threading.
Thanks.