Add OpenGL timer queries to OpenGL3 backend#67032
Conversation
4e15bc2 to
459781e
Compare
This is useful for the visual debugger, printing FPS, and the in-editor FPS display
459781e to
aca964d
Compare
BastiaanOlij
left a comment
There was a problem hiding this comment.
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:
|
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. |
|
Thanks! |
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.