[Texture2DArray] Fix glTexStorage3D/glTexImage3D condition #1222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.