Jump to content
  • Advertisement
Sign in to follow this  
Martin Perry

[Solved] C++ timer library and Compute Shaders

This topic is 2399 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, i have problem measuring times of compute shaders.

I am using QueryPerformanceCounter (and for checking also clock()). Both gave +- same results in ms. But if I measure time on my stopwatch smile.png I gave totally different time.
C++ timer says 10ms, but its rubbish. Application (computer) freezes for about 30 seconds during shader execution.

How can I measure this ?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
I'm guessing that you're measuring the amount of time it takes for the CPU to submit your workload, not the amount of time it takes the GPU to actually execute the work?
Perhaps you should post some code or describe your testing methodology.

Share this post


Link to post
Share on other sites
Version with clock

clock_t initial = clock();
this->deviceContext->Dispatch(this->group.x, this->group.y, this->group.z);

clock_t current = clock();
float diff = (current - initial); //ms

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!