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 7 of 7

Thread: how to keep textures in video card's memory?

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2010
    Posts
    14

    how to keep textures in video card's memory?

    since when i use glTexture2D with client memory pointer, it seems it stores texture in system memory.
    maybe i should use buffers to load texture into video card's memory?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: how to keep textures in video card's memory?

    it seems it stores texture in system memory
    And makes you think this is the case ?

    Typically the GL driver will keep a "backup" copy of the texture in system memory, but it will also be copied to the GPU. Unless you get short on video ram, in this case the texture may be deleted from GPU to free some space. Whenever it is needed again, the driver will re-upload the texture from sys mem to vid mem automatically.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2010
    Posts
    14

    Re: how to keep textures in video card's memory?

    got the idea, but any way to get 'video-ram-only' storage?
    i like memory device context in windows that allows to keep buffers in video card memory,
    dunno if it does always but i was lucky to store big bitmaps without any system memory consumption.

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: how to keep textures in video card's memory?

    No.
    Just be sure to delete the buffer on your application side as soon you did the glTexImage, at least this avoids a third copy.

    Do you have a case for this ? Like a constrained system ram and large unused video ram ?

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2010
    Posts
    14

    Re: how to keep textures in video card's memory?

    no constrains, i'd just like to have smaller memory consumption.
    so i guess buffer objects also have system memory copies?

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: how to keep textures in video card's memory?

    Yes. When you map the buffer, you application is given a pointer to the driver controlled buffer, this is interesting for regularly updating a texture:
    Instead of having to keep the third copy on your side, to resupply the updated texture, you just update the driver one, which then update the gpu once you unmap it.

    Explanations here :
    http://www.songho.ca/opengl/gl_pbo.html#map

  7. #7
    Junior Member Newbie
    Join Date
    Jan 2010
    Posts
    14

    Re: how to keep textures in video card's memory?

    thanx, man

Posting Permissions

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