-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Replace internal uses of insert_or_spawn_batch
#18035
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you split apart the "replace internal usages" from the "deprecate"? The former is uncontroversial, but we're definitely going to get users screaming if we deprecate this without a clear answer on what to do for "allocate this specific entity ID".
insert_or_spawn_batch
and replace internal usesinsert_or_spawn_batch
I had thought not supporting it was the intention, do you know what the official way to do that should look like? |
It is! But I've gotten serious pushback from users before when attempting to just remove it: there's clearly a disconnect there. I'm not sure what the right path forward is there, but we can/should definitely stop using this internally for now. |
Adding to the 0.16 milestone; since this is showing up in real games as a bizarre performance issue I'd like to get the internals moved over ASAP. |
Running through some examples on this PR compared to main:
These errors are not present on the main branch. I am really unexperienced in all of the rendering side of things, so I don't think I'm the right person to track down the cause here. But I'm happy to test again if anyone has ideas. I did not notice any visual differences compared to main, and I didn't see entities disappear unexpectedly. I only spot checked examples that looked suspect to me, so there may be errors I'm missing. If you think it's worth it, I can add an additional example that just spawns and despawns stuff a bunch to see if that triggers any red flags. |
It's strange that I didn't but ok. In that case, I think we proceed. I couldn't find anything else fishy. @alice-i-cecile your thoughts when you get the chance? |
Objective
insert_or_spawn_batch
is due to be deprecated eventually (#15704), and removing uses internally will make that easier.Solution
Replaced internal uses of
insert_or_spawn_batch
withtry_insert_batch
(non-panicking variant becauseinsert_or_spawn_batch
didn't panic).All of the internal uses are in rendering code. Since retained rendering was meant to get rid non-opaque entity IDs, I assume the code was just using
insert_or_spawn_batch
becauseinsert_batch
didn't exist and not because it actually wanted to spawn something. However, I am not confident in my ability to judge rendering code.