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

Rml::Core::ReleaseCompiledGeometries() is not found #84

Closed
ghost opened this issue Mar 3, 2020 · 9 comments
Closed

Rml::Core::ReleaseCompiledGeometries() is not found #84

ghost opened this issue Mar 3, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Mar 3, 2020

In the Android environment, OpenGL resources are automatically destroyed when the application is put on standby. I want to rebuild the resources. What should I do?

// Rml::Core::ReleaseCompiledGeometries(); not found
Rml::Core::ReleaseTextures();

@mikke89
Copy link
Owner

mikke89 commented Mar 3, 2020

Good question. This was removed because it was a heavy resource hog. I figured this could be implemented on the user side, but now I realize the user would probably have to store all the geometry data to be able to do this, which is not very practical.

I will look into re-adding this feature and see if we can do something about the performance impact.

@mikke89
Copy link
Owner

mikke89 commented Mar 3, 2020

I did some measurements to figure out the performance impact with different approaches for the geometry database. Using a std::unordered_set the fps drop was quite noticable.

Here are the total CPU time comparison for inserting to and erasing from the geometry database:

robin_hood::unordered_flat_set
Insert: 1.19%
Erase:  0.70%

std::unordered_set
Insert: 3.79%
Erase:  2.53%

std::set
Insert: 7.52%
Erase:  8.79%

vector with freelist (64bit handle)
Insert: 0,41%
Erase:  0,20%

vector with freelist (32bit handle)
Insert: 0,33%
Erase:  0,17%

I knew std::unordered* was slow, but that is quite a crazy difference compared to the robin_hood set.

Anyway, I think I'll go ahead with the freelist approach, I think the cost is justifiable. Just need to do some more testing before pushing to master.

@mikke89
Copy link
Owner

mikke89 commented Mar 4, 2020

Just added the feature back. Please let me know how it works for you :)

@ghost
Copy link
Author

ghost commented Mar 5, 2020

Thank you! The response is quick and very helpful. I will test it by incorporating it into the application. I'm offering you an app that depends heavily on RMLUI and lua, so I may order more in the future, but thank you. :)
https://play.google.com/store/apps/details?id=net.t_denrai.mmdagent&hl=en

@ghost
Copy link
Author

ghost commented Mar 5, 2020

I tested it.
Geometry is no longer a problem, but there seems to be a problem with the font texture.
New fonts are displayed correctly, but existing fonts
Strings are displayed in black.

Screenshot_20200305-113712_IllustPoser

@mikke89
Copy link
Owner

mikke89 commented Mar 5, 2020

That is great! Let me know if you want me to add it to the gallery :)

I did some investigation, and it looks like the font textures were not released with the call to Core::ReleaseTextures().

I tried to make a fix for it. Hope it works better now!

@ghost
Copy link
Author

ghost commented Mar 6, 2020

Thank you for your prompt reply!
The application has been successfully restored, so I uploaded it immediately.
libRocket is grateful for taking over as the update has stopped.

@mikke89
Copy link
Owner

mikke89 commented Mar 7, 2020

No problem, I'm happy it works for you :)

@mikke89
Copy link
Owner

mikke89 commented Mar 7, 2020

I consider this solved then, let me know otherwise.

@mikke89 mikke89 closed this as completed Mar 7, 2020
@mikke89 mikke89 added the enhancement New feature or request label Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant