Author Topic: Swapping texture data to disk increases loading time .  (Read 854 times)

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Swapping texture data to disk increases loading time .
« on: October 06, 2013, 08:01:48 pm »
   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 ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Swapping texture data to disk increases loading time .
« Reply #1 on: October 06, 2013, 10:01:36 pm »
I'm not sure if i get the question...thinking about it...no, i don't. Can you explain this in more detail, please?

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: Swapping texture data to disk increases loading time .
« Reply #2 on: October 06, 2013, 10:25:00 pm »
    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 .

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Swapping texture data to disk increases loading time .
« Reply #3 on: October 06, 2013, 10:31:30 pm »
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?

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: Swapping texture data to disk increases loading time .
« Reply #4 on: October 07, 2013, 04:01:26 pm »
   Yes maybe that is doing that..... (new framebuffer everytime!). But my app is structured such that changing game level scene creates fresh framebuffer.

Quote
But 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Swapping texture data to disk increases loading time .
« Reply #5 on: October 07, 2013, 08:19:06 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).

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.

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: Swapping texture data to disk increases loading time .
« Reply #6 on: October 07, 2013, 10:13:02 pm »
  Thanks egon!  for the helpful  advice .I will keep this in mind! :).