Advertisement Jump to content
Sign in to follow this  

cg shader time measurement

This topic is 2491 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
I would like to know the exact time measurement for cg shader.
Now I have a display function containing two parts : cuda part computing data, and cg shader render the scene. Like the following :
[color=#444444][font=Tahoma,]time1 = time();[/font]
[color=#444444][font=Tahoma,]time2 = time();[/font]
[color=#444444][font=Tahoma,]cgRender(); //in cgRender render the scene dozens of time.[/font]
[color=#444444][font=Tahoma,]time3 = time();[/font]
[color=#444444][font=Tahoma,]then define: [/font]
[color=#444444][font=Tahoma,]cudaTimebyTime = time2-time1;[/font]
[color=#444444][font=Tahoma,]cudaTimebyEvent = record2-record1;[/font]
[color=#444444][font=Tahoma,]cgTime = time3-time2;[/font]
then I find this:
[color=#444444][font=Tahoma,]cudaTimebyTime != cudaTimebyEvent , which means cudaEvent's time measurement is different from the time() function. [/font]
[color=#444444][font=Tahoma,]what's more, when I change cg function in cgRender(); (cudaTimebyTime - cudaTimebyTime) changes rather than the cgTime. It seems cgTime only records the scene drawing time while cg time measurement parts records in [/font][color=#444444][font=Tahoma,] (cudaTimebyTime - cudaTimebyTime).[/font]

[color=#444444][font=Tahoma,] Can it be true and what's the reason, how should I record the cg time measurement.[/font]

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!