All pastes #1518235 Raw Edit

Untitled

public diff v1 · immutable
#1518235 ·published 2009-08-04 19:09 UTC
rendered paste body
Index: plugins/GSdx/GSPerfMon.cpp===================================================================--- plugins/GSdx/GSPerfMon.cpp	(revision 1598)+++ plugins/GSdx/GSPerfMon.cpp	(working copy)@@ -24,11 +24,11 @@  GSPerfMon::GSPerfMon() 	: m_total(0)-	, m_begin(0) 	, m_frame(0) 	, m_lastframe(0) 	, m_count(0) {+	QueryPerformanceCounter(&m_begin); 	memset(m_counters, 0, sizeof(m_counters)); 	memset(m_stats, 0, sizeof(m_stats)); }@@ -37,14 +37,6 @@ { 	if(c == Frame) 	{-		clock_t now = clock();-		-		if(m_lastframe != 0)-		{-			m_counters[c] += now - m_lastframe;-		}--		m_lastframe = now; 		m_frame++; 		m_count++; 	}@@ -71,29 +63,23 @@  void GSPerfMon::Start() {-	m_start = __rdtsc();--	if(m_begin == 0)-	{-		m_begin = m_start;-	}+	QueryPerformanceCounter(&m_start); }  void GSPerfMon::Stop() {-	if(m_start > 0)-	{-		m_total += __rdtsc() - m_start;-		m_start = 0;-	}+	LARGE_INTEGER now; QueryPerformanceCounter(&now);++	m_total += now.QuadPart - m_start.QuadPart; }  int GSPerfMon::CPU() {-	int percent = (int)(100 * m_total / (__rdtsc() - m_begin));+	LARGE_INTEGER now; QueryPerformanceCounter(&now); -	m_begin = 0;-	m_start = 0;+	int percent = (int)(.5 + 100. * m_total / (now.QuadPart - m_begin.QuadPart));++	QueryPerformanceCounter(&m_begin); 	m_total = 0;  	return percent;Index: plugins/GSdx/GSPerfMon.h===================================================================--- plugins/GSdx/GSPerfMon.h	(revision 1598)+++ plugins/GSdx/GSPerfMon.h	(working copy)@@ -24,12 +24,13 @@ class GSPerfMon { public:-	enum counter_t {Frame, Prim, Draw, Swizzle, Unswizzle, Fillrate, Quad, CounterLast};+	enum counter_t {Prim, Draw, Swizzle, Unswizzle, Fillrate, Quad, CounterLast, Frame};  protected: 	double m_counters[CounterLast]; 	double m_stats[CounterLast];-	uint64 m_begin, m_total, m_start, m_frame;+	uint64 m_frame, m_total;+	LARGE_INTEGER m_begin, m_start; 	clock_t m_lastframe; 	int m_count;