Jump to content
  • Advertisement
hiya83

DX12 Dx12 - timestamp queries

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!