diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-30 12:39:10 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-30 12:39:10 +0200 |
| commit | a7ebf0ddc346756a89c0ea104e41d75ee752cb72 (patch) | |
| tree | 247e51605bd1a9936fdde7009476d56723dd1d0b /src/render/Shader.hpp | |
| parent | 4101006b5ed20efbde2accfbff0403e1ced3d113 (diff) | |
added CPU uniform location lookup optimization
Diffstat (limited to 'src/render/Shader.hpp')
| -rw-r--r-- | src/render/Shader.hpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/render/Shader.hpp b/src/render/Shader.hpp index 4d94358e..f996894b 100644 --- a/src/render/Shader.hpp +++ b/src/render/Shader.hpp @@ -1,22 +1,21 @@ #pragma once #include "../defines.hpp" - -struct SQuad { - GLuint program; - GLint proj; - GLint color; - GLint posAttrib; - GLint texAttrib; -}; +#include <unordered_map> class CShader { public: GLuint program; GLint proj; + GLint color; GLint tex; GLint alpha; GLint posAttrib; GLint texAttrib; GLint discardOpaque; + + GLint getUniformLocation(const std::string&); + +private: + std::unordered_map<std::string, GLint> m_muUniforms; };
\ No newline at end of file |
