summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp
diff options
context:
space:
mode:
authorRodolfo Bogado <rodolfoosvaldobogado@gmail.com>2013-08-23 22:43:03 -0300
committerRodolfo Bogado <rodolfoosvaldobogado@gmail.com>2013-08-23 22:43:03 -0300
commitdbcc677922edb48e57979edea71ab2e6b9b9526b (patch)
tree3e055ae790b6971f5839eef61bbd233d912b7e99 /Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp
parentdfb34ddef4125e403988ce59f2cb07fe91856e42 (diff)
parent40243a4fe7514db647c55bbd808471f59c6454f2 (diff)
Merge remote-tracking branch 'remotes/origin/dx9-ssaa-fix'
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp b/Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp
index 8a1d5c59a9..fafd06e901 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/PerfQuery.cpp
@@ -35,6 +35,8 @@ void PerfQuery::DestroyDeviceObjects()
void PerfQuery::EnableQuery(PerfQueryGroup type)
{
+ if (!ShouldEmulate())
+ return;
// Is this sane?
if (m_query_count > ARRAYSIZE(m_query_buffer) / 2)
WeakFlush();
@@ -58,6 +60,8 @@ void PerfQuery::EnableQuery(PerfQueryGroup type)
void PerfQuery::DisableQuery(PerfQueryGroup type)
{
+ if (!ShouldEmulate())
+ return;
// stop query
if (type == PQG_ZCOMP_ZCOMPLOC || type == PQG_ZCOMP)
{
@@ -74,6 +78,8 @@ void PerfQuery::ResetQuery()
u32 PerfQuery::GetQueryResult(PerfQueryType type)
{
+ if (!ShouldEmulate())
+ return 0;
u32 result = 0;
if (type == PQ_ZCOMP_INPUT_ZCOMPLOC || type == PQ_ZCOMP_OUTPUT_ZCOMPLOC)
@@ -98,6 +104,8 @@ u32 PerfQuery::GetQueryResult(PerfQueryType type)
void PerfQuery::FlushOne()
{
+ if (!ShouldEmulate())
+ return;
auto& entry = m_query_buffer[m_query_read_pos];
DWORD result = 0;
@@ -118,12 +126,16 @@ void PerfQuery::FlushOne()
// TODO: could selectively flush things, but I don't think that will do much
void PerfQuery::FlushResults()
{
+ if (!ShouldEmulate())
+ return;
while (!IsFlushed())
FlushOne();
}
void PerfQuery::WeakFlush()
{
+ if (!ShouldEmulate())
+ return;
while (!IsFlushed())
{
auto& entry = m_query_buffer[m_query_read_pos];
@@ -148,6 +160,8 @@ void PerfQuery::WeakFlush()
bool PerfQuery::IsFlushed() const
{
+ if (!ShouldEmulate())
+ return true;
return 0 == m_query_count;
}