Static geometry memmapped directly from disk ?

I wonder if it is feasible to add such capability to xith3d. In case of static geometry, loading geometry to main memory, only to copy it later to GPU, is a waste. Best solution is to use direct mmaped pointer to load data to GPU and let data stay in file. If for any reason GPU buffer will get invalidated/flushed, data can be recreated from file - but it does not have to be written to swap file in case of mem problem. On the other hand, if there is enough memory, it will be cached in OS disk buffer cache.

Do you think it would be possible to add such hook for xith3d ? Of course, only read-only geometry would be supported and file would have to be in native byte order.

Maybe same thing would be also nice for textures ? They have even bigger chance to be static and there is no point to put them there and back between main mem and swap if OS can handle it by using read-only files.

Excellent idea. We use NIO mem mapped files in Magicosm to great effect. I had never thought about passing that directly onto the card.

Let me think through the possible issues for a couple of days.

Excellent idea about geometry. My +1 for this.

Yuri

If that means +few more fps, then it gets mah +1 as well:P

At least this may bring lower app startup time, as well as lower memory consumption.

Yuri

Be careful with the native byte order issues! I want to play your games on my Mac :). Will this be a porting headache for game developers?

Such files need to be created during install/runtime. For distribution, data would be available in some more ‘official’ format, then on install, cache files with natively ordered data can be built.

You need to do it anyway, in case you want to distribute app by JWS for example - you need plain, uncompressed file on disk for this trick, not getResourceByStream from compressed jar.