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

Add OpenGL timer queries to OpenGL3 backend #67032

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Oct 7, 2022

Fixes: #66464

This is useful for the visual debugger, printing FPS, and the in-editor FPS display

As implemented GPU profiling only works on Desktop devices. There is a GPU timing API that also works on mobile (glBeginQuery/glEndQuery), But it can only measure the time elapsed between two points, it cannot capture timestamps. I initially implemented this with glBeginQuery/glEndQuery but I could not get accurate frame timings.

This is useful for the visual debugger, printing FPS, and the in-editor FPS display
@clayjohn clayjohn force-pushed the GLES3-gpu-profiling branch from 459781e to aca964d Compare October 7, 2022 16:25
Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks cool, my only remark is that if I read it right, this is always on? Do we want that? And do we want this in the runtime version? Or should we add some ifdefs to only include it in debug or tool builds?

@Calinou
Copy link
Member

Calinou commented Oct 20, 2022

Looks cool, my only remark is that if I read it right, this is always on? Do we want that? And do we want this in the runtime version? Or should we add some ifdefs to only include it in debug or tool builds?

In Godot, Vulkan timer queries work in release builds too. This is useful for two reasons:

@clayjohn
Copy link
Member Author

Looks cool, my only remark is that if I read it right, this is always on? Do we want that? And do we want this in the runtime version? Or should we add some ifdefs to only include it in debug or tool builds?

For the reasons that Calinou lists above, I think we want this to always be available, the same as it is for the RenderingDevice backend.

@akien-mga akien-mga merged commit 5a00568 into godotengine:master Oct 31, 2022
@akien-mga
Copy link
Member

Thanks!

@clayjohn clayjohn deleted the GLES3-gpu-profiling branch October 31, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenGL: FPS reported by View Frame Time is incorrect due to missing CPU/GPU frame timing information
4 participants