Use multiple threads to load textures asynchronously.#2913
Use multiple threads to load textures asynchronously.#2913j-jorge wants to merge 1 commit intoaxmolengine:release/2.xfrom
Conversation
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Any reason for not merging this one ? |
|
/gemini review |
|
Important Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services. |
|
/gemini review |
This comment was marked as spam.
This comment was marked as spam.
Reasons for Not Merging this PR
🙏 Thank you very much for your contribution and effort on this PR. |
This PR modifies
TextureCacheto use multiple threads to handle the work ofAddImageAsync. The number of threads is set bystd::thread::hardware_concurrency().TextureCachenow usesstd::unique_ptrto make clear the ownership of data structures related to asynchronous texture loading. Redundant field_asyncRefCounthas been removed. Uses ofstd::dequehas been replaced by the more straightforwardstd::vector.I've tested this in my app on my phone as well as, with ThreadSanitizer enabled, on my laptop.