Tiny unification of code. Save the GL shader cache a bit less often.

This commit is contained in:
Henrik Rydgård 2018-03-13 13:35:44 +01:00
parent 70481c9444
commit 7a8310ae5e
6 changed files with 11 additions and 36 deletions

View File

@ -51,11 +51,6 @@ public:
void ClearShaderCache() override;
void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) override {
primaryInfo = reportingPrimaryInfo_;
fullInfo = reportingFullInfo_;
}
// Using string because it's generic - makes no assumptions on the size of the shader IDs of this backend.
std::vector<std::string> DebugGetShaderIDs(DebugShaderType shader) override;
std::string DebugGetShaderString(std::string id, DebugShaderType shader, DebugShaderStringType stringType) override;
@ -89,7 +84,4 @@ private:
int lastVsync_;
int vertexCost_ = 0;
std::string reportingPrimaryInfo_;
std::string reportingFullInfo_;
};

View File

@ -52,11 +52,6 @@ public:
void ClearShaderCache() override;
void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) override {
primaryInfo = reportingPrimaryInfo_;
fullInfo = reportingFullInfo_;
}
// Using string because it's generic - makes no assumptions on the size of the shader IDs of this backend.
std::vector<std::string> DebugGetShaderIDs(DebugShaderType shader) override;
std::string DebugGetShaderString(std::string id, DebugShaderType shader, DebugShaderStringType stringType) override;
@ -70,7 +65,6 @@ private:
void Flush() {
drawEngine_.Flush();
}
// void ApplyDrawState(int prim);
void CheckFlushOp(int cmd, u32 diff);
void BuildReportingInfo();
@ -89,9 +83,6 @@ private:
int lastVsync_;
int vertexCost_ = 0;
std::string reportingPrimaryInfo_;
std::string reportingFullInfo_;
};
} // namespace DX9

View File

@ -301,7 +301,6 @@ bool GPU_GLES::IsReady() {
return shaderManagerGL_->ContinuePrecompile();
}
// Needs to be called on GPU thread, not reporting thread.
void GPU_GLES::BuildReportingInfo() {
GLRenderManager *render = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
@ -421,7 +420,7 @@ void GPU_GLES::BeginFrame() {
GPUCommon::BeginFrame();
// Save the cache from time to time. TODO: How often?
if (!shaderCachePath_.empty() && (gpuStats.numFlips & 1023) == 0) {
if (!shaderCachePath_.empty() && (gpuStats.numFlips & 4095) == 0) {
shaderManagerGL_->Save(shaderCachePath_);
}

View File

@ -56,11 +56,6 @@ public:
void ClearShaderCache() override;
void CleanupBeforeUI() override;
void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) override {
primaryInfo = reportingPrimaryInfo_;
fullInfo = reportingFullInfo_;
}
// Using string because it's generic - makes no assumptions on the size of the shader IDs of this backend.
std::vector<std::string> DebugGetShaderIDs(DebugShaderType shader) override;
std::string DebugGetShaderString(std::string id, DebugShaderType shader, DebugShaderStringType stringType) override;
@ -92,12 +87,10 @@ private:
FragmentTestCacheGLES fragmentTestCache_;
ShaderManagerGLES *shaderManagerGL_;
std::string shaderCachePath_;
#ifdef _WIN32
int lastVsync_;
#endif
int vertexCost_ = 0;
std::string reportingPrimaryInfo_;
std::string reportingFullInfo_;
std::string shaderCachePath_;
};

View File

@ -247,6 +247,11 @@ public:
typedef void (GPUCommon::*CmdFunc)(u32 op, u32 diff);
void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) override {
primaryInfo = reportingPrimaryInfo_;
fullInfo = reportingFullInfo_;
}
protected:
void SetDrawType(DrawType type, GEPrimitiveType prim) {
if (type != lastDraw_) {
@ -341,6 +346,9 @@ protected:
int immCount_ = 0;
GEPrimitiveType immPrim_;
std::string reportingPrimaryInfo_;
std::string reportingFullInfo_;
private:
void FlushImm();
// Debug stats.

View File

@ -55,11 +55,6 @@ public:
void ClearShaderCache() override;
void GetReportingInfo(std::string &primaryInfo, std::string &fullInfo) override {
primaryInfo = reportingPrimaryInfo_;
fullInfo = reportingFullInfo_;
}
// Using string because it's generic - makes no assumptions on the size of the shader IDs of this backend.
std::vector<std::string> DebugGetShaderIDs(DebugShaderType shader) override;
std::string DebugGetShaderString(std::string id, DebugShaderType shader, DebugShaderStringType stringType) override;
@ -97,9 +92,6 @@ private:
// Manages state and pipeline objects
PipelineManagerVulkan *pipelineManager_;
std::string reportingPrimaryInfo_;
std::string reportingFullInfo_;
// Simple 2D drawing engine.
Vulkan2D vulkan2D_;