Reporting: catch information about the GPU.

This commit is contained in:
Unknown W. Brackets committed 2013-04-29 00:26:43 -07:00
1 parent c3e7440449
commit 5cea38e405
5 files changed
+38 -2

No files matched your search

+8 -2
View File
@@ -20,6 +20,8 @@
#include "Common/StdThread.h"
#include "Core/Config.h"
#include "Core/System.h"
#include "GPU/GPUInterface.h"
#include "GPU/GPUState.h"
#include "net/http_client.h"
#include "net/resolve.h"
@@ -150,12 +152,16 @@ namespace Reporting
const int PARAM_BUFFER_SIZE = 4096;
char temp[PARAM_BUFFER_SIZE];
std::string gpuInfo;
gpu->GetReportingInfo(gpuInfo);
// TODO: Need to escape these values, add more.
snprintf(temp, PARAM_BUFFER_SIZE - 1, "version=%s&game=%s_%s&game_title=%s",
snprintf(temp, PARAM_BUFFER_SIZE - 1, "version=%s&game=%s_%s&game_title=%s&gpu=%s",
PPSSPP_GIT_VERSION,
g_paramSFO.GetValueString("DISC_ID").c_str(),
g_paramSFO.GetValueString("DISC_VERSION").c_str(),
g_paramSFO.GetValueString("TITLE").c_str());
g_paramSFO.GetValueString("TITLE").c_str(),
gpuInfo.c_str());
std::string data;
switch (payload.type)
+23
View File
@@ -194,6 +194,8 @@ GLES_GPU::GLES_GPU()
flushBeforeCommand_[flushBeforeCommandList[i]] = 1;
}
flushBeforeCommand_[1] = 0;
BuildReportingInfo();
}
GLES_GPU::~GLES_GPU() {
@@ -203,6 +205,27 @@ GLES_GPU::~GLES_GPU() {
delete [] flushBeforeCommand_;
}
// Let's avoid passing nulls into snprintf().
static const char *GetGLStringAlways(GLenum name) {
const GLubyte *value = glGetString(name);
if (!value)
return "?";
return (const char *)value;
}
// Needs to be called on GPU thread, not reporting thread.
void GLES_GPU::BuildReportingInfo() {
const char *glVendor = GetGLStringAlways(GL_VENDOR);
const char *glRenderer = GetGLStringAlways(GL_RENDERER);
const char *glVersion = GetGLStringAlways(GL_VERSION);
const char *glSlVersion = GetGLStringAlways(GL_SHADING_LANGUAGE_VERSION);
const char *glExtensions = GetGLStringAlways(GL_EXTENSIONS);
char temp[2048];
snprintf(temp, sizeof(temp), "%s (%s %s), %s (extensions: %s)", glVersion, glVendor, glRenderer, glSlVersion, glExtensions);
reportingInfo_ = temp;
}
void GLES_GPU::DeviceLost() {
// Simply drop all caches and textures.
// FBO:s appear to survive? Or no?
+4
View File
@@ -60,6 +60,7 @@ public:
}
virtual bool FramebufferDirty();
virtual void GetReportingInfo(std::string &info) { info = reportingInfo_; }
std::vector<FramebufferInfo> GetFramebufferList();
protected:
@@ -69,6 +70,7 @@ private:
void DoBlockTransfer();
void ApplyDrawState(int prim);
void CheckFlushOp(u32 op, u32 diff);
void BuildReportingInfo();
// Applies states for debugging if enabled.
void BeginDebugDraw();
@@ -81,4 +83,6 @@ private:
u8 *flushBeforeCommand_;
bool resized_;
std::string reportingInfo_;
};
+2
View File
@@ -21,6 +21,7 @@
#include "GPUState.h"
#include "Core/HLE/sceKernelThread.h"
#include <list>
#include <string>
class PointerWrap;
@@ -186,6 +187,7 @@ public:
// Debugging
virtual void DumpNextFrame() = 0;
virtual void GetReportingInfo(std::string &info) = 0;
virtual const std::list<int>& GetDisplayLists() = 0;
virtual DisplayList* GetCurrentDisplayList() = 0;
virtual bool DecodeTexture(u8* dest, GPUgstate state) = 0;
+1
View File
@@ -42,6 +42,7 @@ public:
virtual void DumpNextFrame() {}
virtual void Resized() {}
virtual void GetReportingInfo(std::string &info) { info = "NULL"; }
protected:
virtual void FastRunLoop(DisplayList &list);