mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Minor refactor allowing getting the GPU profile string outside games
This commit is contained in:
parent
a32249a3cf
commit
be63ce3a4a
@ -492,6 +492,10 @@ public:
|
||||
renderManager_.SetInvalidationCallback(callback);
|
||||
}
|
||||
|
||||
std::string GetGpuProfileString() const override {
|
||||
return renderManager_.GetGpuProfileString();
|
||||
}
|
||||
|
||||
private:
|
||||
void ApplySamplers();
|
||||
|
||||
|
@ -531,6 +531,10 @@ public:
|
||||
renderManager_.SetInvalidationCallback(callback);
|
||||
}
|
||||
|
||||
std::string GetGpuProfileString() const override {
|
||||
return renderManager_.GetGpuProfileString();
|
||||
}
|
||||
|
||||
private:
|
||||
VulkanTexture *GetNullTexture();
|
||||
VulkanContext *vulkan_ = nullptr;
|
||||
|
@ -848,6 +848,10 @@ public:
|
||||
return FrameTimeData{};
|
||||
}
|
||||
|
||||
virtual std::string GetGpuProfileString() const {
|
||||
return "";
|
||||
}
|
||||
|
||||
protected:
|
||||
ShaderModule *vsPresets_[VS_MAX_PRESET];
|
||||
ShaderModule *fsPresets_[FS_MAX_PRESET];
|
||||
|
@ -252,14 +252,6 @@ public:
|
||||
virtual bool GetOutputFramebuffer(GPUDebugBuffer &buffer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO:
|
||||
// cached framebuffers / textures / vertices?
|
||||
// get content of specific framebuffer / texture?
|
||||
// vertex / texture decoding?
|
||||
|
||||
// Note: Wanted to name it GetProfileString but clashes with a Windows API.
|
||||
virtual std::string GetGpuProfileString() { return ""; }
|
||||
};
|
||||
|
||||
bool GPUDebugInitExpression(GPUDebugInterface *g, const char *str, PostfixExpression &exp);
|
||||
|
@ -309,8 +309,3 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) {
|
||||
shaderManagerGL_->GetNumPrograms()
|
||||
);
|
||||
}
|
||||
|
||||
std::string GPU_GLES::GetGpuProfileString() {
|
||||
GLRenderManager *rm = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
return rm->GetGpuProfileString();
|
||||
}
|
||||
|
@ -51,8 +51,6 @@ public:
|
||||
void BeginHostFrame() override;
|
||||
void EndHostFrame() override;
|
||||
|
||||
std::string GetGpuProfileString() override;
|
||||
|
||||
protected:
|
||||
void FinishDeferred() override;
|
||||
|
||||
|
@ -98,9 +98,6 @@ void DrawGPUMemoryVis(UIContext *ui, GPUInterface *gpu) {
|
||||
}
|
||||
|
||||
void DrawGPUProfilerVis(UIContext *ui, GPUInterface *gpu) {
|
||||
if (!gpu) {
|
||||
return;
|
||||
}
|
||||
using namespace Draw;
|
||||
const int padding = 10 + System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_LEFT);
|
||||
const int starty = 50 + System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_TOP);
|
||||
@ -115,8 +112,7 @@ void DrawGPUProfilerVis(UIContext *ui, GPUInterface *gpu) {
|
||||
scale = 0.7f;
|
||||
}
|
||||
|
||||
GPUCommon *gpuCommon = static_cast<GPUCommon *>(gpu);
|
||||
std::string text = gpuCommon->GetGpuProfileString();
|
||||
std::string text = ui->GetDrawContext()->GetGpuProfileString();
|
||||
|
||||
ui->SetFontScale(0.4f, 0.4f);
|
||||
ui->DrawTextShadow(text.c_str(), x, y, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII);
|
||||
|
@ -499,8 +499,3 @@ std::string GPU_Vulkan::DebugGetShaderString(std::string id, DebugShaderType typ
|
||||
return GPUCommonHW::DebugGetShaderString(id, type, stringType);
|
||||
}
|
||||
}
|
||||
|
||||
std::string GPU_Vulkan::GetGpuProfileString() {
|
||||
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
return rm->GetGpuProfileString();
|
||||
}
|
||||
|
@ -59,8 +59,6 @@ public:
|
||||
return textureCacheVulkan_;
|
||||
}
|
||||
|
||||
std::string GetGpuProfileString() override;
|
||||
|
||||
protected:
|
||||
void FinishDeferred() override;
|
||||
void CheckRenderResized() override;
|
||||
|
Loading…
Reference in New Issue
Block a user