Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
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

[DX9/DX10] Profiling

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
1 reply to this topic

#1 maxest   Members   

614
Like
0Likes
Like

Posted 13 December 2012 - 11:06 AM

I've added some profiling calls to my renderer. Basically, it looks like this:
void CRenderer::beginTimeQuery()
{
#ifdef RENDERER_D3D9
  eventQuery->Issue(D3DISSUE_END);
  while (eventQuery->GetData(NULL, 0, D3DGETDATA_FLUSH) == S_FALSE);
  QueryPerformanceCounter(&beginTime);
#elif RENDERER_D3D10
  timestampDisjointQuery->Begin();
  beginTimestampQuery->End();
#endif
}

double CRenderer::endTimeQuery()
{
#ifdef RENDERER_D3D9
  eventQuery->Issue(D3DISSUE_END);
  while (eventQuery->GetData(NULL, 0, D3DGETDATA_FLUSH) == S_FALSE);
  QueryPerformanceCounter(&endTime);
  return (double)(endTime.QuadPart - beginTime.QuadPart) / (double)timeFrequency.QuadPart;
#elif RENDERER_D3D10
  endTimestampQuery->End();
  timestampDisjointQuery->End();
  uint64 beginTime, endTime;
  D3D10_QUERY_DATA_TIMESTAMP_DISJOINT disjoint;
  while (beginTimestampQuery->GetData(&beginTime, sizeof(uint64), 0) != S_OK);
  while (endTimestampQuery->GetData(&endTime, sizeof(uint64), 0) != S_OK);
  while (timestampDisjointQuery->GetData(&disjoint, sizeof(D3D10_QUERY_DATA_TIMESTAMP_DISJOINT), 0) != S_OK);
  if (!disjoint.Disjoint)
   return (double)(endTime - beginTime) / (double)disjoint.Frequency;
  else
   return -1.0;
#endif
}

Now, I render 2500 cubes, what gives me 230 FPS with both renderers. The problem is that the timings returned by endTimeQuery differ. For D3D9 it returns 0.003 and for D3D10 returns 0.0013. The rendering code does not do anything else and I wrapped the whole rendering loop inside the begin/end time block. So, where does this discrepancy could come from?

#2 maxest   Members   

614
Like
0Likes
Like

Posted 17 December 2012 - 05:58 AM

Bump. Any idea?




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.