Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Carving up GPU memory dynamically

  1. #11
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,193
    Quote Originally Posted by Nowhere-01 View Post
    This part, i don't quite get. How do you "force allocation on GPU" without allocating and uploading texture to VRAM...
    I wasn't saying that you could. What I'm saying is that when you create and initially populate textures via the GL API, you're often just doing so with a copy of the texture in CPU memory. If you then flip a bunch of them in-view and try to draw with them, you'll get a huge frame time spike because none of them are actually on the GPU yet. Thus the need to prerender with them to force the driver to actually allocate them in GPU memory.

  2. #12
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    I just realized something. You can use view-texture aliases to achieve at least some of what you want. It doesn't give you everything you want, since you can only alias formats between textures of the same pixel size. So you can't pretend that a DXT5 texture is a DXT1 texture of twice the width or something.

    But, through the use of 2D array textures, you can pretty much dole out anything, from cubemaps to just 2D textures, to whatever. With full mipmap pyramids and everything.

    Obviously, there are limitations for this approach. Specifically, that it wastes a lot of memory if all of the textures are not the same size. And the format limitations I mentioned earlier. But it could work for some of the more egregious cases.

  3. #13
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,193
    Thanks! I'll definitely read up on that.

    Unfortunately, in our use cases there typically is only one format used with a specific avg size per-texel. Of format and res, res is of course the memory killer of those two axes (e.g. you can't make everything 4096^2 maps).

Posting Permissions

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