Permalink
Browse files

GPU: Track stats on uploads.

A lot can lead to slowdown, so it's useful when logging frame drops.
  • Loading branch information...
unknownbrackets committed Dec 29, 2017
1 parent c948a3d commit 0151c5e649167b4fe6e7950134ef6953a12f6704
Showing with 11 additions and 4 deletions.
  1. +1 −0 GPU/Common/FramebufferCommon.cpp
  2. +2 −1 GPU/D3D11/GPU_D3D11.cpp
  3. +2 −1 GPU/Directx9/GPU_DX9.cpp
  4. +2 −1 GPU/GLES/GPU_GLES.cpp
  5. +2 −0 GPU/GPU.h
  6. +2 −1 GPU/Vulkan/GPU_Vulkan.cpp
@@ -738,6 +738,7 @@ void FramebufferManagerCommon::DrawPixels(VirtualFramebuffer *vfb, int dstX, int
DrawTextureFlags flags = (vfb || g_Config.iBufFilter == SCALE_LINEAR) ? DRAWTEX_LINEAR : DRAWTEX_NEAREST;
Bind2DShader();
DrawActiveTexture(dstX, dstY, width, height, vfb->bufferWidth, vfb->bufferHeight, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags);
gpuStats.numUploads++;
}
void FramebufferManagerCommon::CopyFramebufferForColorTexture(VirtualFramebuffer *dst, VirtualFramebuffer *src, int flags) {
View
@@ -527,7 +527,7 @@ void GPU_D3D11::GetStats(char *buffer, size_t bufsize) {
"Cached, Uncached Vertices Drawn: %i, %i\n"
"FBOs active: %i\n"
"Textures active: %i, decoded: %i invalidated: %i\n"
"Readbacks: %d\n"
"Readbacks: %d, uploads: %d\n"
"Vertex, Fragment shaders loaded: %i, %i\n",
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawCalls,
@@ -546,6 +546,7 @@ void GPU_D3D11::GetStats(char *buffer, size_t bufsize) {
gpuStats.numTexturesDecoded,
gpuStats.numTextureInvalidations,
gpuStats.numReadbacks,
gpuStats.numUploads,
shaderManagerD3D11_->GetNumVertexShaders(),
shaderManagerD3D11_->GetNumFragmentShaders()
);
View
@@ -501,7 +501,7 @@ void GPU_DX9::GetStats(char *buffer, size_t bufsize) {
"Cached, Uncached Vertices Drawn: %i, %i\n"
"FBOs active: %i\n"
"Textures active: %i, decoded: %i invalidated: %i\n"
"Readbacks: %d\n"
"Readbacks: %d, uploads: %d\n"
"Vertex, Fragment shaders loaded: %i, %i\n",
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawCalls,
@@ -520,6 +520,7 @@ void GPU_DX9::GetStats(char *buffer, size_t bufsize) {
gpuStats.numTexturesDecoded,
gpuStats.numTextureInvalidations,
gpuStats.numReadbacks,
gpuStats.numUploads,
shaderManagerDX9_->GetNumVertexShaders(),
shaderManagerDX9_->GetNumFragmentShaders()
);
View
@@ -733,7 +733,7 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) {
"Cached, Uncached Vertices Drawn: %i, %i\n"
"FBOs active: %i\n"
"Textures active: %i, decoded: %i invalidated: %i\n"
"Readbacks: %d\n"
"Readbacks: %d, uploads: %d\n"
"Vertex, Fragment, Programs loaded: %i, %i, %i\n",
gpuStats.msProcessingDisplayLists * 1000.0f,
gpuStats.numDrawCalls,
@@ -752,6 +752,7 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) {
gpuStats.numTexturesDecoded,
gpuStats.numTextureInvalidations,
gpuStats.numReadbacks,
gpuStats.numUploads,
shaderManagerGL_->GetNumVertexShaders(),
shaderManagerGL_->GetNumFragmentShaders(),
shaderManagerGL_->GetNumPrograms());
View
@@ -68,6 +68,7 @@ struct GPUStatistics {
numFlushes = 0;
numTexturesDecoded = 0;
numReadbacks = 0;
numUploads = 0;
numClears = 0;
msProcessingDisplayLists = 0;
vertexGPUCycles = 0;
@@ -88,6 +89,7 @@ struct GPUStatistics {
int numShaderSwitches;
int numTexturesDecoded;
int numReadbacks;
int numUploads;
int numClears;
double msProcessingDisplayLists;
int vertexGPUCycles;
@@ -668,7 +668,7 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) {
"Cached, Uncached Vertices Drawn: %i, %i\n"
"FBOs active: %i\n"
"Textures active: %i, decoded: %i invalidated: %i\n"
"Readbacks: %d\n"
"Readbacks: %d, uploads: %d\n"
"Vertex, Fragment, Pipelines loaded: %i, %i, %i\n"
"Pushbuffer space used: UBO %d, Vtx %d, Idx %d\n"
"%s\n",
@@ -689,6 +689,7 @@ void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) {
gpuStats.numTexturesDecoded,
gpuStats.numTextureInvalidations,
gpuStats.numReadbacks,
gpuStats.numUploads,
shaderManagerVulkan_->GetNumVertexShaders(),
shaderManagerVulkan_->GetNumFragmentShaders(),
pipelineManager_->GetNumPipelines(),

0 comments on commit 0151c5e

Please sign in to comment.