Celtoys / Remotery

Single C file, Realtime CPU/GPU Profiler with Remote Web Viewer
Apache License 2.0
3.11k stars 264 forks source link

[DX12] where/when should I call rmt_MarkFrame()? #217

Closed yhyu13 closed 2 years ago

yhyu13 commented 2 years ago

Hi, I am having trouble understanding rmt_MarkFrame() for DX12:

Is rmt_MarkFrame() called internally by remotery anywhere coz I couldn't find any.

Since it is required that no GPU sampling begin before it and end after it, I have to know where/when it is invoked in a single frame. Or is it totally controlled by us users?

Is there any best practice to where/when to invoke rmt_MarkFrame(), begining of next frame or the end of current frame?

Thanks~!

dwilliamson commented 2 years ago

You call rmt_MarkFrame yourself. If your engine has its own concept of BeginFrame/EndFrame then it's best to place it right before your EndFrame when you can guarantee your engine has no open Remotery GPU samples.