-
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
Implement GL timer queries #1239
base: master
Are you sure you want to change the base?
Conversation
Add GL timers for major parts of the engine (frame, depth pre-pass, opaque, transparent, post-process, cull and depth reduction)
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.
Cool, I didn't know there is a way to time these things.
What's the plan for how to use the cgame API? If you add a console command for printing the timers, the timer code could be merged to master and only any API parts need to go in for-0.55.
@@ -313,6 +314,10 @@ namespace Render { | |||
IPC::Message<IPC::Id<VM::QVM, CG_R_GETSHADERNAMEFROMHANDLE>, int>, | |||
IPC::Reply<std::string> | |||
>; | |||
using GetEngineTimersMsg = IPC::SyncMessage< | |||
IPC::Message<IPC::Id<VM::QVM, CG_R_GETENGINETIMERS>>, | |||
IPC::Reply<EngineTimers*> |
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.
Sending a pointer through inter-process communication doesn't make sense.
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.
Yeah, I think it can just be made shared instead.
} | ||
|
||
// This will retrieve the time in nanoseconds if this query was issued before, otherwise 0 | ||
// This will block the CPU until the query becomes available |
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.
Are there any cases where it can really block? If so I guess we should avoid updating the timers when they are not being used.
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.
Yea, the plan is to have a cvar to enable/disable timers completely. Hence why the pr is draft, here just so it doesn't get lost.
Somehow I've missed this comment. Cgame is only supposed to receive the data and display it if some cvar is enabled. I'll be redoing a large part of cgame side of this anyway. |
Add GL timers for major parts of the engine (frame, depth pre-pass, opaque, transparent, post-process, cull and depth reduction)