Advertisement

What is ID3D12CommandQueue::GetTimestampFrequency used for?

Started by July 28, 2017 04:37 PM
5 comments, last by MJP 7 years, 6 months ago

What do I need it for, but practically? I read the very few words in MSDN saying what it does, but I need a practical pseudo-example of how would you use it and what you obtain from using it.

Generally, such a method is used to take the results from queries that return timestamps in ticks and convert them to seconds (by dividing by the frequency).

I don't recall if the D3D12 timing-related queries return ticks offhand, as I've never used them in practice, but this would my guess.

Timing-related queries in general are often used for measuring performance and tracking optimizations.

Advertisement

If you never used them in practice and if they are intended for measuring purposes, I guess I will not pay attention to timestamps then.

9 minutes ago, NikiTo said:

If you never used them in practice

I am not a good metric of what a modern graphics programmer should or shouldn't be doing though. :D

@jpetrie Anyways, I plan to render off-screen as part of a video transcoding filter, so I don't have a 60 FPS to take into account. When it's done, it's done, I don't mind timing too much. I guess I could skip timestamps completely.
 

D3D12 supports timestamp queries, which lets you track when things execute on the GPU. By issuing pairs of timestamp queries, you can then determine how long it too the GPU to execute the commands in between the queries. The queries give results in terms of ticks, and GetTimestampFrequency will let you convert from ticks to seconds. You can look at my Profiler class if you want to see an example of how to do this.

This topic is closed to new replies.

Advertisement