Add documentation to PerfQueryBase interface.
Remove the config field for perf queries (wasn't used for the new interface anyway). Few other cleanups.
This commit is contained in:
parent
5a7bb2abfa
commit
4058b4c38a
|
@ -485,7 +485,7 @@ void BPWritten(const BPCmd& bp)
|
||||||
case BPMEM_IND_IMASK: // Index Mask ?
|
case BPMEM_IND_IMASK: // Index Mask ?
|
||||||
case BPMEM_REVBITS: // Always set to 0x0F when GX_InitRevBits() is called.
|
case BPMEM_REVBITS: // Always set to 0x0F when GX_InitRevBits() is called.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BPMEM_CLEAR_PIXEL_PERF:
|
case BPMEM_CLEAR_PIXEL_PERF:
|
||||||
// GXClearPixMetric writes 0xAAA here, Sunshine alternates this register between values 0x000 and 0xAAA
|
// GXClearPixMetric writes 0xAAA here, Sunshine alternates this register between values 0x000 and 0xAAA
|
||||||
g_perf_query->ResetQuery();
|
g_perf_query->ResetQuery();
|
||||||
|
|
|
@ -195,7 +195,7 @@ void VideoFifo_CheckPerfQueryRequest()
|
||||||
|
|
||||||
u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type)
|
u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type)
|
||||||
{
|
{
|
||||||
// Is this check sane?
|
// TODO: Is this check sane?
|
||||||
if (!g_perf_query->IsFlushed())
|
if (!g_perf_query->IsFlushed())
|
||||||
{
|
{
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread)
|
||||||
|
@ -207,7 +207,7 @@ u32 VideoBackendHardware::Video_GetQueryResult(PerfQueryType type)
|
||||||
else
|
else
|
||||||
g_perf_query->FlushResults();
|
g_perf_query->FlushResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
return g_perf_query->GetQueryResult(type);
|
return g_perf_query->GetQueryResult(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,24 @@ public:
|
||||||
PerfQueryBase() {};
|
PerfQueryBase() {};
|
||||||
virtual ~PerfQueryBase() {}
|
virtual ~PerfQueryBase() {}
|
||||||
|
|
||||||
|
// Begin querying the specified value for the following host GPU commands
|
||||||
virtual void EnableQuery(PerfQueryGroup type) {}
|
virtual void EnableQuery(PerfQueryGroup type) {}
|
||||||
|
|
||||||
|
// Stop querying the specified value for the following host GPU commands
|
||||||
virtual void DisableQuery(PerfQueryGroup type) {}
|
virtual void DisableQuery(PerfQueryGroup type) {}
|
||||||
|
|
||||||
|
// Reset query counters to zero and drop any pending queries
|
||||||
virtual void ResetQuery() {}
|
virtual void ResetQuery() {}
|
||||||
|
|
||||||
|
// Return the measured value for the specified query type
|
||||||
|
// NOTE: Called from CPU thread
|
||||||
virtual u32 GetQueryResult(PerfQueryType type) { return 0; }
|
virtual u32 GetQueryResult(PerfQueryType type) { return 0; }
|
||||||
|
|
||||||
|
// Request the value of any pending queries - causes a pipeline flush and thus should be used carefully!
|
||||||
virtual void FlushResults() {}
|
virtual void FlushResults() {}
|
||||||
|
|
||||||
|
// True if there are no further pending query results
|
||||||
|
// NOTE: Called from CPU thread
|
||||||
virtual bool IsFlushed() const { return true; }
|
virtual bool IsFlushed() const { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -299,7 +299,6 @@ void Read16(u16& _uReturnValue, const u32 _iAddress)
|
||||||
// Later builds returned 1 for the high register. That caused the timer to actually count down, but made the challenge unbeatable because the game always thought you didn't clear any goop at all.
|
// Later builds returned 1 for the high register. That caused the timer to actually count down, but made the challenge unbeatable because the game always thought you didn't clear any goop at all.
|
||||||
// Note that currently this functionality is only implemented in the D3D11 backend.
|
// Note that currently this functionality is only implemented in the D3D11 backend.
|
||||||
_uReturnValue = g_video_backend->Video_GetQueryResult(PQ_BLEND_INPUT) & 0xFFFF;
|
_uReturnValue = g_video_backend->Video_GetQueryResult(PQ_BLEND_INPUT) & 0xFFFF;
|
||||||
//ERROR_LOG(VIDEO, "PQ_BLEND_INPUT: %d", g_video_backend->Video_GetQueryResult(PQ_BLEND_INPUT));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PE_PERF_BLEND_INPUT_H:
|
case PE_PERF_BLEND_INPUT_H:
|
||||||
|
|
|
@ -105,7 +105,6 @@ void VideoConfig::Load(const char *ini_file)
|
||||||
iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
|
iniFile.Get("Hacks", "EFBScaledCopy", &bCopyEFBScaled, true);
|
||||||
iniFile.Get("Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable, false);
|
iniFile.Get("Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable, false);
|
||||||
iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);
|
iniFile.Get("Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges, false);
|
||||||
iniFile.Get("Hacks", "DisablePixelPerf", &bDisablePixelPerf, true);
|
|
||||||
|
|
||||||
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
|
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
|
||||||
|
|
||||||
|
@ -154,7 +153,6 @@ void VideoConfig::GameIniLoad(const char *ini_file)
|
||||||
iniFile.GetIfExists("Video_Hacks", "EFBScaledCopy", &bCopyEFBScaled);
|
iniFile.GetIfExists("Video_Hacks", "EFBScaledCopy", &bCopyEFBScaled);
|
||||||
iniFile.GetIfExists("Video_Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable);
|
iniFile.GetIfExists("Video_Hacks", "EFBCopyCacheEnable", &bEFBCopyCacheEnable);
|
||||||
iniFile.GetIfExists("Video_Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges);
|
iniFile.GetIfExists("Video_Hacks", "EFBEmulateFormatChanges", &bEFBEmulateFormatChanges);
|
||||||
iniFile.GetIfExists("Video_Hacks", "DisablePixelPerf", &bDisablePixelPerf);
|
|
||||||
|
|
||||||
iniFile.GetIfExists("Video", "ProjectionHack", &iPhackvalue[0]);
|
iniFile.GetIfExists("Video", "ProjectionHack", &iPhackvalue[0]);
|
||||||
iniFile.GetIfExists("Video", "PH_SZNear", &iPhackvalue[1]);
|
iniFile.GetIfExists("Video", "PH_SZNear", &iPhackvalue[1]);
|
||||||
|
@ -233,7 +231,6 @@ void VideoConfig::Save(const char *ini_file)
|
||||||
iniFile.Set("Hacks", "EFBScaledCopy", bCopyEFBScaled);
|
iniFile.Set("Hacks", "EFBScaledCopy", bCopyEFBScaled);
|
||||||
iniFile.Set("Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
|
iniFile.Set("Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
|
||||||
iniFile.Set("Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
|
iniFile.Set("Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
|
||||||
iniFile.Set("Hacks", "DisablePixelPerf", bDisablePixelPerf);
|
|
||||||
|
|
||||||
iniFile.Set("Hardware", "Adapter", iAdapter);
|
iniFile.Set("Hardware", "Adapter", iAdapter);
|
||||||
|
|
||||||
|
@ -289,7 +286,6 @@ void VideoConfig::GameIniSave(const char* default_ini, const char* game_ini)
|
||||||
SET_IF_DIFFERS("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
|
SET_IF_DIFFERS("Video_Hacks", "EFBScaledCopy", bCopyEFBScaled);
|
||||||
SET_IF_DIFFERS("Video_Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
|
SET_IF_DIFFERS("Video_Hacks", "EFBCopyCacheEnable", bEFBCopyCacheEnable);
|
||||||
SET_IF_DIFFERS("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
|
SET_IF_DIFFERS("Video_Hacks", "EFBEmulateFormatChanges", bEFBEmulateFormatChanges);
|
||||||
SET_IF_DIFFERS("Video_Hacks", "DisablePixelPerf", bDisablePixelPerf);
|
|
||||||
|
|
||||||
iniFile.Save(game_ini);
|
iniFile.Save(game_ini);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ struct VideoConfig
|
||||||
int iAnaglyphStereoSeparation;
|
int iAnaglyphStereoSeparation;
|
||||||
int iAnaglyphFocalAngle;
|
int iAnaglyphFocalAngle;
|
||||||
bool b3DVision;
|
bool b3DVision;
|
||||||
|
|
||||||
// Hacks
|
// Hacks
|
||||||
bool bEFBAccessEnable;
|
bool bEFBAccessEnable;
|
||||||
bool bDlistCachingEnable;
|
bool bDlistCachingEnable;
|
||||||
|
@ -133,7 +133,6 @@ struct VideoConfig
|
||||||
bool bZTPSpeedHack; // The Legend of Zelda: Twilight Princess
|
bool bZTPSpeedHack; // The Legend of Zelda: Twilight Princess
|
||||||
bool bUseBBox;
|
bool bUseBBox;
|
||||||
bool bEnablePixelLighting;
|
bool bEnablePixelLighting;
|
||||||
bool bDisablePixelPerf;
|
|
||||||
|
|
||||||
int iLog; // CONF_ bits
|
int iLog; // CONF_ bits
|
||||||
int iSaveTargetId; // TODO: Should be dropped
|
int iSaveTargetId; // TODO: Should be dropped
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
#include "ConfigManager.h"
|
#include "ConfigManager.h"
|
||||||
#include "VideoBackend.h"
|
#include "VideoBackend.h"
|
||||||
|
#include "PerfQueryBase.h"
|
||||||
|
|
||||||
namespace DX9
|
namespace DX9
|
||||||
{
|
{
|
||||||
|
@ -156,12 +157,6 @@ bool VideoBackend::Initialize(void *&window_handle)
|
||||||
|
|
||||||
s_BackendInitialized = true;
|
s_BackendInitialized = true;
|
||||||
|
|
||||||
if (!g_Config.bDisablePixelPerf)
|
|
||||||
{
|
|
||||||
OSD::AddMessage("PE perf metrics enabled although the D3D9 backend doesn't support them!");
|
|
||||||
OSD::AddMessage("Try a different backend when issues arise.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,6 +171,7 @@ void VideoBackend::Video_Prepare()
|
||||||
g_vertex_manager = new VertexManager;
|
g_vertex_manager = new VertexManager;
|
||||||
g_renderer = new Renderer;
|
g_renderer = new Renderer;
|
||||||
g_texture_cache = new TextureCache;
|
g_texture_cache = new TextureCache;
|
||||||
|
g_perf_query = new PerfQueryBase;
|
||||||
// VideoCommon
|
// VideoCommon
|
||||||
BPInit();
|
BPInit();
|
||||||
Fifo_Init();
|
Fifo_Init();
|
||||||
|
@ -213,6 +209,7 @@ void VideoBackend::Shutdown()
|
||||||
// internal interfaces
|
// internal interfaces
|
||||||
PixelShaderCache::Shutdown();
|
PixelShaderCache::Shutdown();
|
||||||
VertexShaderCache::Shutdown();
|
VertexShaderCache::Shutdown();
|
||||||
|
delete g_perf_query;
|
||||||
delete g_texture_cache;
|
delete g_texture_cache;
|
||||||
delete g_renderer;
|
delete g_renderer;
|
||||||
delete g_vertex_manager;
|
delete g_vertex_manager;
|
||||||
|
|
Loading…
Reference in New Issue