Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

VReaperV
Copy link
Contributor

Add GL timers for major parts of the engine (frame, depth pre-pass, opaque, transparent, post-process, cull and depth reduction)

Add GL timers for major parts of the engine (frame, depth pre-pass, opaque, transparent, post-process, cull and depth reduction)
Copy link
Member

@slipher slipher left a 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*>
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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.

@VReaperV VReaperV added T-Improvement Improvement for an existing feature A-Renderer T-Performance labels Aug 22, 2024
@VReaperV
Copy link
Contributor Author

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.

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.

@illwieckz illwieckz changed the base branch from for-0.55.0/sync to master November 4, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Renderer T-Improvement Improvement for an existing feature T-Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants