summaryrefslogtreecommitdiff
path: root/indra/llrender/llshadermgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llshadermgr.h')
-rw-r--r--indra/llrender/llshadermgr.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 3da7a2a5f3..8c19c80cb0 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -302,7 +302,7 @@ public:
void dumpShaderSource(U32 shader_code_count, GLchar** shader_code_text);
BOOL linkProgramObject(GLuint obj, BOOL suppress_errors = FALSE);
BOOL validateProgramObject(GLuint obj);
- GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map<std::string, std::string>* defines = NULL, S32 texture_index_channels = -1);
+ GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::map<std::string, std::string>* defines = NULL, S32 texture_index_channels = -1);
// Implemented in the application to actually point to the shader directory.
virtual std::string getShaderDirPrefix(void) = 0; // Pure Virtual
@@ -310,6 +310,13 @@ public:
// Implemented in the application to actually update out of date uniforms for a particular shader
virtual void updateShaderUniforms(LLGLSLShader * shader) = 0; // Pure Virtual
+ void initShaderCache(bool enabled, const LLUUID& old_cache_version, const LLUUID& current_cache_version);
+ void clearShaderCache();
+ void persistShaderCacheMetadata();
+
+ bool loadCachedProgramBinary(LLGLSLShader* shader);
+ bool saveCachedProgramBinary(LLGLSLShader* shader);
+
public:
// Map of shader names to compiled
std::map<std::string, GLuint> mVertexShaderObjects;
@@ -320,8 +327,16 @@ public:
std::vector<std::string> mReservedUniforms;
- //preprocessor definitions (name/value)
- std::map<std::string, std::string> mDefinitions;
+ struct ProgramBinaryData
+ {
+ GLsizei mBinaryLength = 0;
+ GLenum mBinaryFormat = 0;
+ F32 mLastUsedTime = 0.0;
+ };
+ std::map<LLUUID, ProgramBinaryData> mShaderBinaryCache;
+ bool mShaderCacheInitialized = false;
+ bool mShaderCacheEnabled = false;
+ std::string mShaderCacheDir;
protected: