View Full Version : ARB_texture_storage

Dark Photon
06-20-2012, 05:18 AM
(See poll above)

On which vendors?

06-20-2012, 10:49 AM
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.

Dark Photon
06-20-2012, 04:41 PM
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.

06-20-2012, 06:37 PM
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:

// 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.

06-23-2012, 02:42 AM
No noticeable performance gain (<1%) on Linux 3.2.8, 4.2 compatible profile, AMD HD 6350