Permalink
Browse files

Display: Avoid limiting FPS without a clear.

A bit of a dirty heuristic to avoid the slowdown in #8538.
  • Loading branch information...
unknownbrackets committed Dec 27, 2017
1 parent 4657397 commit f9750dd13723c6b1b2837235e9f98e7d8fe3485a
View
@@ -918,7 +918,7 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync)
u64 now = CoreTiming::GetTicks();
s64 cyclesAhead = nextFlipCycles - now;
if (cyclesAhead > FLIP_DELAY_CYCLES_MIN) {
if (lastFlipsTooFrequent >= FLIP_DELAY_MIN_FLIPS) {
if (lastFlipsTooFrequent >= FLIP_DELAY_MIN_FLIPS && gpuStats.numClears > 0) {
delayCycles = cyclesAhead;
} else {
++lastFlipsTooFrequent;
@@ -1297,6 +1297,9 @@ bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size,
}
return false;
} else if (dstBuffer) {
if (isMemset) {
gpuStats.numClears++;
}
WARN_LOG_ONCE(btucpy, G3D, "Memcpy fbo upload %08x -> %08x", src, dst);
if (g_Config.bBlockTransferGPU) {
FlushBeforeCopy();
@@ -408,6 +408,7 @@ void SoftwareTransform(
// Need to rescale from a [0, 1] float. This is the final transformed value.
result->depth = ToScaledDepth((s16)(int)(transformed[1].z * 65535.0f));
result->action = SW_CLEAR;
gpuStats.numClears++;
return;
}
}
@@ -560,5 +561,9 @@ void SoftwareTransform(
}
}
if (gstate.isModeClear()) {
gpuStats.numClears++;
}
result->action = SW_DRAW_PRIMITIVES;
}
View
@@ -518,7 +518,7 @@ void GPU_D3D11::GetStats(char *buffer, size_t bufsize) {
float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f;
snprintf(buffer, bufsize - 1,
"DL processing time: %0.2f ms\n"
"Draw calls: %i, flushes %i\n"
"Draw calls: %i, flushes %i, clears %i\n"
"Cached Draw calls: %i\n"
"Num Tracked Vertex Arrays: %i\n"
"GPU cycles executed: %d (%f per vertex)\n"
@@ -532,6 +532,7 @@ void GPU_D3D11::GetStats(char *buffer, size_t bufsize) {
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawCalls,
gpuStats.numFlushes,
gpuStats.numClears,
gpuStats.numCachedDrawCalls,
gpuStats.numTrackedVertexArrays,
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,
View
@@ -492,7 +492,7 @@ void GPU_DX9::GetStats(char *buffer, size_t bufsize) {
float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f;
snprintf(buffer, bufsize - 1,
"DL processing time: %0.2f ms\n"
"Draw calls: %i, flushes %i\n"
"Draw calls: %i, flushes %i, clears %i\n"
"Cached Draw calls: %i\n"
"Num Tracked Vertex Arrays: %i\n"
"GPU cycles executed: %d (%f per vertex)\n"
@@ -506,6 +506,7 @@ void GPU_DX9::GetStats(char *buffer, size_t bufsize) {
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawCalls,
gpuStats.numFlushes,
gpuStats.numClears,
gpuStats.numCachedDrawCalls,
gpuStats.numTrackedVertexArrays,
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,
View
@@ -693,7 +693,7 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) {
float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f;
snprintf(buffer, bufsize - 1,
"DL processing time: %0.2f ms\n"
"Draw calls: %i, flushes %i\n"
"Draw calls: %i, flushes %i, clears %i\n"
"Cached Draw calls: %i\n"
"Num Tracked Vertex Arrays: %i\n"
"GPU cycles executed: %d (%f per vertex)\n"
@@ -707,6 +707,7 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) {
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawCalls,
gpuStats.numFlushes,
gpuStats.numClears,
gpuStats.numCachedDrawCalls,
gpuStats.numTrackedVertexArrays,
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,
View
@@ -68,6 +68,7 @@ struct GPUStatistics {
numFlushes = 0;
numTexturesDecoded = 0;
numReadbacks = 0;
numClears = 0;
msProcessingDisplayLists = 0;
vertexGPUCycles = 0;
otherGPUCycles = 0;
@@ -87,6 +88,7 @@ struct GPUStatistics {
int numShaderSwitches;
int numTexturesDecoded;
int numReadbacks;
int numClears;
double msProcessingDisplayLists;
int vertexGPUCycles;
int otherGPUCycles;
@@ -656,7 +656,7 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) {
float vertexAverageCycles = gpuStats.numVertsSubmitted > 0 ? (float)gpuStats.vertexGPUCycles / (float)gpuStats.numVertsSubmitted : 0.0f;
snprintf(buffer, bufsize - 1,
"DL processing time: %0.2f ms\n"
"Draw calls: %i, flushes %i\n"
"Draw calls: %i, flushes %i, clears %i\n"
"Cached Draw calls: %i\n"
"Num Tracked Vertex Arrays: %i\n"
"GPU cycles executed: %d (%f per vertex)\n"
@@ -672,6 +672,7 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) {
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawCalls,
gpuStats.numFlushes,
gpuStats.numClears,
gpuStats.numCachedDrawCalls,
gpuStats.numTrackedVertexArrays,
gpuStats.vertexGPUCycles + gpuStats.otherGPUCycles,

0 comments on commit f9750dd

Please sign in to comment.