Jump to content
  • Advertisement
hiya83

DX12 Dx12 - timestamp queries

This topic is 373 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

Hi all,

Any idea what the mechanism is for timing commands in the GPU command buffer in DX12 now? In DX11 it was BeginDisjoint, End's, EndDisjoint, GetData's. But in DX12, I see I can place EndQuery with a timestamp type, and I also see GetTimestampFrequency to get the frequency, but how do I get the tick value for each of the timestamp EndQuery's? I see ResolveQueryData, but that places the data in a GPU buffer, am I supposed to call that and then copy the data over? If so what is the format of that data? Unfortunately, I have yet to see a sample for timestamp queries yet. 

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

Yep, you're totally on the right track. The ResolveQueryData takes data from the query heap, which can be in a hardware-dependent format, and puts it in a buffer, one which is probably CPU-accessible, in the canonical format. Once the resolve operation is complete, you can read the contents of the buffer to get your timestamps.

Resolve can handle data from multiple query heap entries, and the output is one UINT64 per resolved timestamp, just like D3D11's GetData.

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!