Jump to content
  • Advertisement
NikiTo

DX12 What is ID3D12CommandQueue::GetTimestampFrequency used for?

This topic is 506 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

@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.
 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!