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

Add support for reinitializing handle after reinitializing textures #7

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gilzoide
Copy link
Owner

This adds the TextureApplyAsyncHandle.Reinitialize method that should be called manually after reinitializing the target texture of a handle. This avoids crashing the app because of accessing freed memory on the native plugin.

The PlasmaColorJob sample scene uses this with OnValidate, so you can change the texture's width/height in editor and it will get properly reinitialized.

Fixes #5.

This method should be called after reinitializing a Texture2D to ensure the buffer is still valid, avoiding crashes
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.

" handle.ScheduleUpdateOnce" will make unity crash when Texture.Reinitialize() if not executed Texture.Apply()
1 participant