summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2016-01-06 23:29:51 +0100
committerPierre Bourdon <delroth@gmail.com>2016-01-06 23:29:51 +0100
commit3c65a7dd7f665eaea093806cfc280e3692b70aec (patch)
tree6166a471269a9b1eb2bf703a31c915489e428b44 /Source/Core/VideoCommon
parent7fcb5a803b2e6179fe57654496fcea7f6b2ff183 (diff)
parentefbe5bc4b651d1f7f726bb064255e0e2562f7490 (diff)
Merge pull request #3156 from degasus/videosw2
VideoSW: Use VideoCommon framework and drop redundant code
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/CPMemory.h1
-rw-r--r--Source/Core/VideoCommon/Statistics.cpp16
-rw-r--r--Source/Core/VideoCommon/Statistics.h11
-rw-r--r--Source/Core/VideoCommon/VertexLoaderManager.cpp1
-rw-r--r--Source/Core/VideoCommon/VideoConfig.cpp17
-rw-r--r--Source/Core/VideoCommon/VideoConfig.h9
6 files changed, 55 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/CPMemory.h b/Source/Core/VideoCommon/CPMemory.h
index 491f818305..59183fe47f 100644
--- a/Source/Core/VideoCommon/CPMemory.h
+++ b/Source/Core/VideoCommon/CPMemory.h
@@ -257,6 +257,7 @@ struct CPState final
BitSet32 attr_dirty;
bool bases_dirty;
VertexLoaderBase* vertex_loaders[8];
+ int last_id;
};
class PointerWrap;
diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp
index 04164cdaed..53db2fcf50 100644
--- a/Source/Core/VideoCommon/Statistics.cpp
+++ b/Source/Core/VideoCommon/Statistics.cpp
@@ -8,6 +8,7 @@
#include "Common/StringUtil.h"
#include "VideoCommon/Statistics.h"
#include "VideoCommon/VertexLoaderManager.h"
+#include "VideoCommon/VideoConfig.h"
Statistics stats;
@@ -27,6 +28,21 @@ void Statistics::SwapDL()
std::string Statistics::ToString()
{
std::string str;
+
+ if (g_ActiveConfig.backend_info.APIType == API_TYPE::API_NONE)
+ {
+ str += StringFromFormat("Objects: %i\n", stats.thisFrame.numDrawnObjects);
+ str += StringFromFormat("Vertices Loaded: %i\n", stats.thisFrame.numVerticesLoaded);
+ str += StringFromFormat("Triangles Input: %i\n", stats.thisFrame.numTrianglesIn);
+ str += StringFromFormat("Triangles Rejected: %i\n", stats.thisFrame.numTrianglesRejected);
+ str += StringFromFormat("Triangles Culled: %i\n", stats.thisFrame.numTrianglesCulled);
+ str += StringFromFormat("Triangles Clipped: %i\n", stats.thisFrame.numTrianglesClipped);
+ str += StringFromFormat("Triangles Drawn: %i\n", stats.thisFrame.numTrianglesDrawn);
+ str += StringFromFormat("Rasterized Pix: %i\n", stats.thisFrame.rasterizedPixels);
+ str += StringFromFormat("TEV Pix In: %i\n", stats.thisFrame.tevPixelsIn);
+ str += StringFromFormat("TEV Pix Out: %i\n", stats.thisFrame.tevPixelsOut);
+ }
+
str += StringFromFormat("Textures created: %i\n", stats.numTexturesCreated);
str += StringFromFormat("Textures uploaded: %i\n", stats.numTexturesUploaded);
str += StringFromFormat("Textures alive: %i\n", stats.numTexturesAlive);
diff --git a/Source/Core/VideoCommon/Statistics.h b/Source/Core/VideoCommon/Statistics.h
index edd70bdf97..26c663a513 100644
--- a/Source/Core/VideoCommon/Statistics.h
+++ b/Source/Core/VideoCommon/Statistics.h
@@ -52,6 +52,17 @@ struct Statistics
int bytesVertexStreamed;
int bytesIndexStreamed;
int bytesUniformStreamed;
+
+ int numTrianglesClipped;
+ int numTrianglesIn;
+ int numTrianglesRejected;
+ int numTrianglesCulled;
+ int numDrawnObjects;
+ int rasterizedPixels;
+ int numTrianglesDrawn;
+ int numVerticesLoaded;
+ int tevPixelsIn;
+ int tevPixelsOut;
};
ThisFrame thisFrame;
void ResetFrame();
diff --git a/Source/Core/VideoCommon/VertexLoaderManager.cpp b/Source/Core/VideoCommon/VertexLoaderManager.cpp
index baf04ba52a..5012dea9d8 100644
--- a/Source/Core/VideoCommon/VertexLoaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderManager.cpp
@@ -124,6 +124,7 @@ void MarkAllDirty()
static VertexLoaderBase* RefreshLoader(int vtx_attr_group, bool preprocess = false)
{
CPState* state = preprocess ? &g_preprocess_cp_state : &g_main_cp_state;
+ state->last_id = vtx_attr_group;
VertexLoaderBase* loader;
if (state->attr_dirty[vtx_attr_group])
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp
index 626e1f0bd0..50486d716a 100644
--- a/Source/Core/VideoCommon/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/VideoConfig.cpp
@@ -87,6 +87,15 @@ void VideoConfig::Load(const std::string& ini_file)
settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false);
settings->Get("BorderlessFullscreen", &bBorderlessFullscreen, false);
+ settings->Get("SWZComploc", &bZComploc, true);
+ settings->Get("SWZFreeze", &bZFreeze, true);
+ settings->Get("SWDumpObjects", &bDumpObjects, false);
+ settings->Get("SWDumpTevStages", &bDumpTevStages, false);
+ settings->Get("SWDumpTevTexFetches", &bDumpTevTextureFetches, false);
+ settings->Get("SWDrawStart", &drawStart, 0);
+ settings->Get("SWDrawEnd", &drawEnd, 100000);
+
+
IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
enhancements->Get("ForceFiltering", &bForceFiltering, 0);
enhancements->Get("MaxAnisotropy", &iMaxAnisotropy, 0); // NOTE - this is x in (1 << x)
@@ -287,6 +296,14 @@ void VideoConfig::Save(const std::string& ini_file)
settings->Set("EnableShaderDebugging", bEnableShaderDebugging);
settings->Set("BorderlessFullscreen", bBorderlessFullscreen);
+ settings->Set("SWZComploc", bZComploc);
+ settings->Set("SWZFreeze", bZFreeze);
+ settings->Set("SWDumpObjects", bDumpObjects);
+ settings->Set("SWDumpTevStages", bDumpTevStages);
+ settings->Set("SWDumpTevTexFetches", bDumpTevTextureFetches);
+ settings->Set("SWDrawStart", drawStart);
+ settings->Set("SWDrawEnd", drawEnd);
+
IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
enhancements->Set("ForceFiltering", bForceFiltering);
enhancements->Set("MaxAnisotropy", iMaxAnisotropy);
diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h
index 5b88e64c2f..bc0250ab2f 100644
--- a/Source/Core/VideoCommon/VideoConfig.h
+++ b/Source/Core/VideoCommon/VideoConfig.h
@@ -136,6 +136,15 @@ struct VideoConfig final
// Debugging
bool bEnableShaderDebugging;
+ // VideoSW Debugging
+ int drawStart;
+ int drawEnd;
+ bool bZComploc;
+ bool bZFreeze;
+ bool bDumpObjects;
+ bool bDumpTevStages;
+ bool bDumpTevTextureFetches;
+
// Static config per API
// TODO: Move this out of VideoConfig
struct