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.
33 lines
552 B
C++
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
|