Files
oak-editor/app/render/backend/opengl/openglshadercache.h
T
itsmattkc 3b224c7638 multithreaded download and files that probably should have been in the last
commit

For testing the new iteration, the texture cache disk download was written
into the main thread instead of into the separate threads. Now they're back
in separate threads again.

Also I think some of these files probably should have been in the previous
commit.
2019-11-06 09:14:20 +11:00

33 lines
552 B
C++

#ifndef OPENGLSHADERCACHE_H
#define OPENGLSHADERCACHE_H
#include <QMutex>
#include "node/output.h"
#include "openglshader.h"
/**
* @brief Thread-safe cache of OpenGL shaders
*/
class OpenGLShaderCache
{
public:
OpenGLShaderCache();
void Clear();
void AddShader(NodeOutput* output, OpenGLShaderPtr shader);
OpenGLShaderPtr GetShader(NodeOutput* output);
bool HasShader(NodeOutput* output);
private:
QString GenerateShaderID(NodeOutput* output);
QMap<QString, OpenGLShaderPtr> compiled_nodes_;
};
#endif // OPENGLSHADERCACHE_H