-
Notifications
You must be signed in to change notification settings - Fork 60
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
Move some skeleton building to cgame, batch IPC #1386
base: for-0.56.0/sync
Are you sure you want to change the base?
Conversation
Which models use the pure-gamelogic implementation? If there are many of those it could be worth breaking out into a separate non-compat-breaking PR. |
All buildings. I'll see if I can make it not require IPC calls at all, but it would probably require duplicating |
It looks like there's also some really stupid back-and-forth with a ton of copying: getting the skeleton from engine, copying it into a |
I tried it and got |
Yeah, I'm assuming it's because some value isn't valid on the first frame the entity appears. |
This seems to be the best course of action to me right now:
I think that should be sufficient, but I might've missed some skeleton usage that precludes this. |
So I've tried this, but went down the rabbit hole of loading iqm to get the animations, so I'm just gonna skip that and make the proper change to |
I tested this branch (with game counterpart) on a slow device, on The hardware is Intel X3100 (GMA 965, Gen 4), on a Core 2 Duo L7500 (dual core). This GPU doesn't implement the features required for model skinning so the driver emulates it. Our own alternate code (enabled with
So the branch will likely benefit gameplays like PVE games, but not the vanilla game. |
I have started a branch that moves the skeleton stuff to engine instead and skips the expensive copies. This seems to be working faster than this branch, although I still need to make it actually build the skeletons on the engine side with the values it receives. |
Complementary pr to: Unvanquished/Unvanquished#3146.
I've profiled building-heavy scenes, and the most time was spent waiting for IPC when building the skeleton. The building of the skeletons itself can be moved completely to cgame I believe. I'm not sure if
tr.animations
can be moved there as well, however, since it's also used for other things (at least for culling). Additionally, I might implement GPU-driven skeleton building, which might be even faster since it would avoid uploading all the bones, doing more shader switches etc.So for now I've copied the skeleton build functions over to cgame and added an IPC call to get a bunch of animation structs at once. There are definitely still things to clean up with that code, and there's probably a better more general solution, but this works already: this scene on
plat23
with 176 eggs + om in view went from 50 to 100 FPS from this change:Profiling shows that most of the time is now actually being spent building the skeleton, in some SSE function, rather than waiting for IPC.
The layout I used to test this can be found here: https://users.unvanquished.net/~reaper/maps/layouts/plat23/test.dat.