-
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
cg_api: implement trap_R_BatchInPVS
to test if a bunch of entities are in PVS in one call
#852
Conversation
03873a7
to
c0f071f
Compare
trap_R_inPVSArray
to test array of entities in PVS in one calltrap_R_BatchInPVS
to test if a bunch of entities are in PVS in one call
c0f071f
to
8b92208
Compare
I rewrote this using lessons learned while implementing: The code now sends and receives the shortest vector possible for valid and active entities only. Commits are meant to be squashed so one would probably better want to review this as a whole. |
8b92208
to
b3abc82
Compare
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.
We should ultimately avoid the IPC entirely by implementing inPVS in the cgame, but this is fine for now.
LGTM to the engine side.
b3abc82
to
4cfa908
Compare
src/engine/client/cl_cgame.cpp
Outdated
|
||
size_t numEntities = posEntities.size(); | ||
|
||
inPVS.reserve(MAX_LOCATIONS); |
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.
Does it makes sense to also do a inPVS.reserve(MAX_LOCATIONS);
here as inPVS
is an argument?
I tried it, the code builds and run, but I don't know if that changes something.
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.
It doesn't make sense to have both reserve
and resize
. You can do either reserve+push_back, or resize+a[b]=c
.
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.
I rewrote that part, in fact I could iterate the source array directly by using push_back
for the destination, which looks cleaner.
02a0300
to
5ccf637
Compare
That's exactly my opinion. I would like to see this in cgame to avoid IPC entirely in the future, but this is something I can reach today and the benefit is there, so we can start with that. |
5ccf637
to
0aecb36
Compare
0aecb36
to
81af01e
Compare
e5e8f44
to
9feec82
Compare
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
9feec82
to
ba610a3
Compare
Any comment on the game counterpart? |
…e in PVS in one call
ba610a3
to
561b0f9
Compare
Implement
trap_R_inPVSArray
to test array of entities in PVS in one call.Engine sidecar of:
trap_R_BatchInPVS
to test if a bunch of entities are in PVS in one call Unvanquished/Unvanquished#2679