Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 10

Thread: Prioritize textures?

  1. #1
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Prioritize textures?

    Hi,

    I remenber lately the prioritize textures and textures residents mecanisum. Is this really useful... managed by the drivers? This mecanisum seams really great in theory so I'm wondering why there isn't such mecanisum for buffer object... any reason? (I may have missed this feature is actually available on buffer object...)

    Cheers,
    Christophe

  2. #2
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,979

    Re: Prioritize textures?

    Similar mechanism is provided via buffer creation hints... keep in mind that driver mostly treats this as hints, so don't rely on them too much!

  3. #3
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: Prioritize textures?

    Do you mean GL_STATIC_* GL_STREAM_* GL_DYNAMIC_* ?

  4. #4
    Intern Contributor
    Join Date
    Aug 2004
    Posts
    52

    Re: Prioritize textures?

    Hmmm... just my own opinion, but I think, texture priorities are completely pointless. I would not spend my time on this. It's a simple matter of fact, a texture is used in a frame, or not. Regardless of it's priority.

  5. #5
    Intern Contributor
    Join Date
    Aug 2004
    Posts
    52

    Re: Prioritize textures?

    Me again... The comparision with buffers is simply wrong. Buffer creation hints are usage hints.

  6. #6
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Prioritize textures?

    It doesn't make sense for apps where all textures fit into texture memory (mind this is not only onboard memory, there is also AGP resp. PCI-E memory) or where all textures are needed in each frame anyway, but it's far from pointless.

    Think of it as a hint to the implementation which textures are important and which are not (like a bool, use values 0.0 and 1.0).

    The implementation knows which textures are required for rendering. The more interesting information for it is actually which textures are NOT important, because those are the better candidates for eviction if textures need to be made resident.

    Consider this simple example: For any heavily textured scene, e.g. ground in a flight sim, you can tag the textures in the view and the ones which will come into view next with prio 1.0 and those which are definitely not in the view for the next period of time with prio zero. That way the implementation could always evict the unimportant textures first in case not all textures fit into texture memory.

    Don't screw up the priorization though, it's just a hint.

  7. #7
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: Prioritize textures?

    That extractly the way I was thinking : application that need more graphic memory than the graphic card have. If the drivers optimize the transfert from the main memory that seams to me very interessing. In other hand, I would need to create and delete textures to keep every drawn textures residents ...

  8. #8
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,979

    Re: Prioritize textures?

    Quote Originally Posted by EvilOne
    Me again... The comparision with buffers is simply wrong. Buffer creation hints are usage hints.
    Yes, and texture priorities are usage hints too.

  9. #9
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Prioritize textures?

    Quote Originally Posted by Groovounet
    In other hand, I would need to create and delete textures to keep every drawn textures residents ...
    No, there are three places where textures can reside:
    In host memory, in PCI-E memory, and onboard.
    The latter two can be directly accessed by the GPU for texturing.
    The priorization addresses which ones get swapped out to host memory first. Prioritize your textures so that the ones which are likely to be used in the next frame have a 1.0 prio and the ones which are definitely not used a 0.0. That way those prio 0.0 textures get scrapped from the scarce texture memory first, but stay in host memory for the driver to reload once needed.

    That all doesn't help if your texture working set size per frame is bigger than the available sum of texture memory.

  10. #10
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    936

    Re: Prioritize textures?

    Thank, I will try this way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •