Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use subimage versions during texture update #5759

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

slimbuck
Copy link
Member

This PR updates the texture upload logic similar to #5758.

Updating the data of an existing gl-side texture is relatively slow using gl.texImage2D because a new gl-side texture is created every time. It's faster to use gl.texSubImage2D instead, which will update the existing texture data.

This PR requires thorough testing, especially with editor projects, to ensure edge cases are correctly covered.

Testing Notes:

  • each creation and update path needs testing: 2d and cubemap, pixel data and browser interface sources

@slimbuck slimbuck added the area: graphics Graphics related issue label Oct 17, 2023
@slimbuck slimbuck requested a review from a team October 17, 2023 11:11
@slimbuck slimbuck self-assigned this Oct 17, 2023
@heretique heretique mentioned this pull request Oct 17, 2023
@marklundin
Copy link
Member

marklundin commented Oct 18, 2023

This is great @slimbuck, also I did not know this, so I've learned something new. 👏

@slimbuck slimbuck merged commit 74e8f47 into playcanvas:main Oct 18, 2023
7 checks passed
@slimbuck slimbuck deleted the tex-update branch October 18, 2023 15:11
marklundin pushed a commit that referenced this pull request Nov 3, 2023
* use subimage versions of texture update

* lint
@slimbuck slimbuck mentioned this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants