Swapping texture data to disk increases loading time .

Started by Wolf17, October 06, 2013, 08:01:48 PM

Previous topic - Next topic

Wolf17

   I wanted to reduce the loading  time . Is that possible ? I mean , once the data is in the disk , I don't want it to be re-written . Is there is a way to check that ?

EgonOlsen

I'm not sure if i get the question...thinking about it...no, i don't. Can you explain this in more detail, please?

Wolf17

    Oh! sorry for that!
      I meant that when  I use virtualiser to push some of the textures into disk , my level takes longer to show up (Loading level ) than usual . And this occurs every time I load my level (longer load time) because it reloads all of the textures with each fresh start up . The textures I want to load in the disk are the ones which would be used frequently in every levels and won't be altered. I thought that it would be nice to use virtualiser so that it would use less VM .

EgonOlsen

I see. Textures will be uploaded again only if the gl context changes (i.e. if you create a new FrameBuffer) or if they have been unloaded from the gpu before. If that's what you do, then that's what you get. The idea of the Virtualizer is to trade VM memory for disk space and loading time. If you swap the texture to disk and it's has to be uploaded again, then it will take additional time to do this. But as said, if you only change the levels, i don't see why you need a new texture upload at all. Are you unloading the textures?

Wolf17

   Yes maybe that is doing that..... (new framebuffer everytime!). But my app is structured such that changing game level scene creates fresh framebuffer.

QuoteBut as said,
if you only change the levels, i don't see why
you need a new texture upload 

Actually i meant that starting any level (or replaying ) swaps data to disk and that is what i want to avoid(i.e re-writing same data again and again.). I need a way to check that if the data exist in disk then do not transfer any data.

EgonOlsen

Quote from: Wolf17 on October 07, 2013, 04:01:26 PM
But my app is structured such that changing game level scene creates fresh framebuffer.
If possible, restructure. It's usually not needed and increases start-up time (as you have noticed already).

Quote from: Wolf17 on October 07, 2013, 04:01:26 PM
Actually i meant that starting any level (or replaying ) swaps data to disk and that is what i want to avoid(i.e re-writing same data again and again.). I need a way to check that if the data exist in disk then do not transfer any data.
There's no such method and that's not the way the Virtualizer works. If you keep the Virtualizer instance and the textures (i.e. not reload it on each level change) and don't call virtualize() on the textures more than once , it should access the once stored files (until an app restart occurs, of course). If you initialize everything from scratch all the time, then you will have to live with the additional overhead but then it doesn't make much sense to use the Virtualizer anyway.

Wolf17

  Thanks egon!  for the helpful  advice .I will keep this in mind! :).