Add some stats to get some idea of much alpha tested drawing we do.

Turns out it's one hell of a lot and we really should fix this by
checking both vertices and textures to deduce when we can just skip
alpha testing safely, probably quite often.

I care about this because alpha testing drawing is very expensive
on some mobile chips.
This commit is contained in:
Henrik Rydgard 2013-08-27 20:58:27 +02:00
parent d6709a0b32
commit 6360fcb0ae
6 changed files with 17 additions and 16 deletions

View file

@ -16,7 +16,7 @@
// http://code.google.com/p/dolphin-emu/
#include <algorithm>
#include "base/logging.h"
#include "LogManager.h"
#include "ConsoleListener.h"
#include "Timer.h"
@ -280,6 +280,6 @@ void FileLogListener::Log(LogTypes::LOG_LEVELS, const char *msg)
void DebuggerLogListener::Log(LogTypes::LOG_LEVELS, const char *msg)
{
#if _MSC_VER
::OutputDebugStringA(msg);
OutputDebugStringUTF8(msg);
#endif
}

View file

@ -275,6 +275,8 @@ void __DisplayGetDebugStats(char stats[2048]) {
"Most active syscall: %s : %0.2f ms\n"
"Draw calls: %i, flushes %i\n"
"Cached Draw calls: %i\n"
"Alpha Tested draws: %i\n"
"Non Alpha Tested draws: %i\n"
"Num Tracked Vertex Arrays: %i\n"
"Cycles executed: %d (%f per vertex)\n"
"Commands per call level: %i %i %i %i\n"
@ -297,6 +299,8 @@ void __DisplayGetDebugStats(char stats[2048]) {
gpuStats.numDrawCalls,
gpuStats.numFlushes,
gpuStats.numCachedDrawCalls,
gpuStats.numAlphaTestedDraws,
gpuStats.numNonAlphaTestedDraws,
gpuStats.numTrackedVertexArrays,
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,
vertexAverageCycles,

View file

@ -141,6 +141,11 @@ void ComputeFragmentShaderID(FragmentShaderID *id) {
id->d[0] |= (doTextureProjection & 1) << 16;
id->d[0] |= (enableColorDoubling & 1) << 17;
id->d[0] |= (enableAlphaDoubling & 1) << 18;
if (enableAlphaTest)
gpuStats.numAlphaTestedDraws++;
else
gpuStats.numNonAlphaTestedDraws++;
}
}

View file

@ -449,6 +449,8 @@ struct GPUStatistics {
numShaderSwitches = 0;
numFlushes = 0;
numTexturesDecoded = 0;
numAlphaTestedDraws = 0;
numNonAlphaTestedDraws = 0;
msProcessingDisplayLists = 0;
vertexGPUCycles = 0;
otherGPUCycles = 0;
@ -472,6 +474,9 @@ struct GPUStatistics {
int otherGPUCycles;
int gpuCommandsAtCallLevel[4];
int numAlphaTestedDraws;
int numNonAlphaTestedDraws;
// Total statistics, updated by the GPU core in UpdateStats
int numVBlanks;
int numFlips;

View file

@ -44,7 +44,6 @@
#include "math/math_util.h"
#include "math/lin/matrix4x4.h"
#include "ui/screen.h"
#include "ui/ui.h"
#include "ui/ui_context.h"
#include "ui/view.h"
@ -403,16 +402,6 @@ void NativeInitGraphics() {
UIShader_Init();
// Old style theme, to be removed later
UITheme theme = {0};
theme.uiFont = UBUNTU24;
theme.uiFontSmall = UBUNTU24;
theme.uiFontSmaller = UBUNTU24;
theme.buttonImage = I_SOLIDWHITE; // not using classic buttons
theme.buttonSelected = I_SOLIDWHITE;
theme.checkOn = I_CHECKEDBOX;
theme.checkOff = I_SQUARE;
// memset(&ui_theme, 0, sizeof(ui_theme));
// New style theme
ui_theme.uiFont = UBUNTU24;
@ -453,8 +442,6 @@ void NativeInitGraphics() {
ui_draw2d.Init();
ui_draw2d_front.Init();
UIInit(&ui_atlas, theme);
uiTexture = new Texture();
if (!uiTexture->Load("ui_atlas.zim")) {
PanicAlert("Failed to load ui_atlas.zim.\n\nPlace it in the directory \"assets\" under your PPSSPP directory.");

2
native

@ -1 +1 @@
Subproject commit ed1df8fb888c9cabd8d0dcba15a1e4a8686538db
Subproject commit b063724c9e4364613fe8af66439d56ed0fbf049c