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

Make isCompatibleTexture check stricter by requiring equal source #5529

Merged
merged 1 commit into from
May 29, 2024

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented May 29, 2024

Description:
The compatibility check for textures allowed changes of the underlying source. Depending on the state of the texture in Three.js this might actually not be supported, causing incorrect reference counting, potentially leading to an exception upon disposal of the texture.

Instead of trying to inspect the internal state to make a decision, it's easier to make the check considerably stricter. This PR now requires the source to match the prior source. While this does lead to more texture instance being created when changing images, the corresponding Source (actual image data) and WebGLTexture resources remain shared whenever possible.

Changes proposed:

  • Make isCompatibleTexture check stricter by requiring source to match previous source.

@dmarcos
Copy link
Member

dmarcos commented May 29, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants