OpenSceneGraph icon indicating copy to clipboard operation
OpenSceneGraph copied to clipboard

[Texture2DArray] Fix glTexStorage3D/glTexImage3D condition

Open madsbuvi opened this issue 2 years ago • 0 comments

When generateAndAssignTextureObject() returns a re-used texture object with _allocated set to true, and texStorageSizedInternalFormat != 0, Texture2DArray calls glTexImage3D with this texture object bound. This is an error because in this case Texture2DArray has already called glTexStorage3D on this texture object the first time this re-used TextureObject was used.

This PR proposes a fix for this issue. This code is based on the corresponding code in Texture2D.cpp

edit: I think !934 was an attempt at fixing this, but that fix doesn't work for Texture2DArray because the check against _allocated is in the wrong place.

madsbuvi avatar Apr 23 '23 17:04 madsbuvi