-
Notifications
You must be signed in to change notification settings - Fork 53
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
vita2d_free_texture crash when texture loaded with vita2d_load_PNG_file #28
Comments
That's because the GPU is still using the texture while you are freeing it. |
Hum hum ok, so we have to use "vita2d_fini" before freeing them. It's not really convenient ! |
After you free them, do you pretend to continue drawing other things or just exit the application? |
Yeah I noticed this happened to me as well. I agree with @Cpasjuste, calling vit2d_fini before freeing isn't really convenient. Is there any way to overcome this? |
Wait vblank should do it. |
@Cpasjuste and @joel16 You should have a look at START_DRAWING() and END_DTAWING in @TheOfficialFloW s VitaShell: https://github.com/henkaku/VitaShell/blob/master/main.h Then you can take a look at photo.c, which uses free_texture in a way that works, without calling vita2d_fini: https://github.com/henkaku/VitaShell/blob/master/photo.c You will notice it can be important where you call it:
When you have issues, try looking at how it's done in working examples like VitaShell |
@Cpasjuste if you want to continue using vita2d after freeing your images, you should call vita2d_wait_rendering_done(); before freeing them, this will block until the GPU has finished rendering. |
I encountered the same issue in my own project and found that the problem lies within the function After This resulted in an error when |
Hi,
it seems there's a bug when we try to free a texture loaded with vita2d_load_PNG_file, the device crash.
Here's an example :
vita2d_texture *tex =
vita2d_load_PNG_file("app0:data/test.png");
...draw...
vita2d_free_texture(tex); -> crash
The text was updated successfully, but these errors were encountered: