Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

cg shader time measurement

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 sienaiwun   Members   

141
Like
0Likes
Like

Posted 24 March 2012 - 07:37 AM

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 :
Display()
{
time1 = time();
cudaEventRecord(record1);
RunCuda();
cudaEventRecord(record2);
time2 = time();
cgRender(); //in cgRender render the scene dozens of time.
time3 = time();
}
then define:
cudaTimebyTime = time2-time1;
cudaTimebyEvent = record2-record1;
cgTime = time3-time2;
then I find this:
cudaTimebyTime != cudaTimebyEvent , which means cudaEvent's time measurement is different from the time() function.
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 (cudaTimebyTime - cudaTimebyTime).


Can it be true and what's the reason, how should I record the cg time measurement.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.