Skip to content

Add OpenGL timer queries to OpenGL3 backend#67032

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:GLES3-gpu-profiling
Oct 31, 2022
Merged

Add OpenGL timer queries to OpenGL3 backend#67032
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:GLES3-gpu-profiling

Conversation

@clayjohn

@clayjohn clayjohn commented Oct 7, 2022

Copy link
Copy Markdown
Member

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

@BastiaanOlij BastiaanOlij left a comment

Copy link
Copy Markdown
Contributor

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

Calinou commented Oct 20, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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