easy_profiler icon indicating copy to clipboard operation
easy_profiler copied to clipboard

GPU timing for OpenGL

Open cas4ey opened this issue 7 years ago • 6 comments

cas4ey avatar Mar 02 '17 14:03 cas4ey

Any idea how that is done in general? Is it like getting opengl API calls wrapped in EASY_BLOCK or is there more magic behind it?

rokups avatar Mar 11 '17 15:03 rokups

I think it's necessary another type of block for GPU-timing. As far as I know gpu time measure in OpenGL needs call glBeginQuery... and after swap buffering (or similar) glEndQuery. In many case that is doing in different functions. In that case it's needs explicitly call something like EASY_GPU_BLOCK_END. Since I haven't enough experience in OpenGL I'm studying it now =) We have some good examples of custom gpu-measuring. I think we will integrate it in easy_profiler in near future.

yse avatar Mar 11 '17 16:03 yse

I found apitrace. Looks like they do profiling by hooking each API call.

rokups avatar Mar 12 '17 14:03 rokups

I might take a stab at this if nobody gets to it before me, but I'm busy atm. @yse I would advise against glBeginQuery because you cannot nest it, so you can't actually measure blocks within blocks. It is better to use glQueryCounter which simply requests the GPU to provide you with a timestamp for when the GPU reaches this call. You do this at the beginning and end of each block and then keep checking whether the counter result is available until you can store it in the profile.

looki avatar Jun 18 '17 08:06 looki

@looki I'm really sorry that we have ignored your suggestion, but we have been very busy and missed your message 😞 It would be nice if you can help with the feature if you are still interested. @yse can you please participate in discussion or should we take a break (or even freeze it) for GPU profiling feature?

cas4ey avatar Jul 28 '17 21:07 cas4ey

@looki did you happen to start any work regarding this?

rokups avatar Apr 23 '18 15:04 rokups