[gles] Fix tex_sub_image_* calls not always adjusting to target texture#3641
Merged
teoxoy merged 2 commits intogfx-rs:masterfrom Apr 4, 2023
Merged
[gles] Fix tex_sub_image_* calls not always adjusting to target texture#3641teoxoy merged 2 commits intogfx-rs:masterfrom
tex_sub_image_* calls not always adjusting to target texture#3641teoxoy merged 2 commits intogfx-rs:masterfrom
Conversation
tex_sub_image calls not always adjusting to target typetex_sub_image_* calls not always adjusting to target type
tex_sub_image_* calls not always adjusting to target typetex_sub_image_* calls not always adjusting to target type
tex_sub_image_* calls not always adjusting to target typetex_sub_image_* calls not always adjusting to target texture
38cefab to
c6b6e14
Compare
teoxoy
reviewed
Apr 3, 2023
Member
teoxoy
left a comment
There was a problem hiding this comment.
Looks good but I think we should also handle TEXTURE_CUBE_MAP_ARRAY.
Contributor
Author
Done! I also simplified the code a bit. I updated OP with some details, would be great if you could confirm my assumptions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Connections
Fixes #3197.
Description
In GLES different arguments have to be passed into
tex_sub_image_*calls depending on the target texture. Specifically cube maps, 2D texture arrays and cube map arrays. This was done correctly in some calls, specificallywrite_texture, but not in others.This fixes it.
Testing
There was a test actually testing
copy_external_image_to_texturefor texture array, which was expected to fail, it succeeds now.Details
The following functions now take the array index into account (only listing changes):
copy_external_image_to_texturewhen targeting cube maps, 2D texture arrays and cube map arrays.copy_texture_to_texturewhen targeting 2D texture arrays and cube map arrays.copy_buffer_to_texturewhen targeting uncompressed cube map arrays.copy_buffer_to_texturewhen targeting compressed 2D texture arrays and cube map arrays.Basically the change is to make sure that all calls to
tex_sub_image_*take into account the following:offset_zparameter.targetparameter.