Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

View Poll Results: Have you seen a performance improvement in using glTexStorage* vs. glTexImage*?

Voters
2. You may not vote on this poll
  • Yes

    0 0%
  • No

    2 100.00%
Results 1 to 5 of 5

Thread: ARB_texture_storage

  1. #1
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    ARB_texture_storage

    (See poll above)

    On which vendors?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941
    I don't think you can see any major performance benefit from using immutable textures as long as the driver has to support mutable textures. I believe immutable textures could provide quite visible benefits if mutable textures were to be removed, however, that's not going to happen due to backward compatibility.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882
    That's what I was suspecting but thought I'd check with everyone. Suspect there's probably a "validated" bit (or bits) on the texture that the driver tracks for every texture and checks to avoid needless revalidation every time. It'd just be true for TexStorage built textures.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941
    Don't get me wrong, there way be situations that can already benefit from using ARB_texture_storage, in the worst case, just by having cleaner code. Not to mention that you can create an "empty" mipmapped texture with a single GL call instead of log(size) calls. Also, it forces you to write proper, efficient code as with immutable textures you cannot do such craziness like these:
    Code :
    // pulling out the storage from under a framebuffer attachment
    // (it would work, just it's likely to hit your performance hard, not to mention that your framebuffer can easily become incomplete "behind your back")
    glBindFramebuffer(GL_FRAMEBUFFER, myFBO);
    glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, myTexture, 0);
    ...
    glBindTexture(GL_TEXTURE_2D, myTexture);
    glTexImage2D(GL_TEXTURE_2D, ...);
     
    // specifying mipmap levels with mismatching internal format or sizes that don't respect mipmap size rules
    // (not sure if this is even allowed by the core or compatibility spec, maybe the texture ends up incomplete)
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
    glTexImage2D(GL_TEXTURE_2D, 1, GL_RG32F, 384, 128, 0, GL_RG, GL_FLOAT, NULL);

    Note: never ever do something like these if you don't want to make problems for yourself.

    Btw, if you use texture storage, you can't get into such situations.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  5. #5
    Intern Contributor Zenja's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    50
    No noticeable performance gain (<1%) on Linux 3.2.8, 4.2 compatible profile, AMD HD 6350

Posting Permissions

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