From a7ebf0ddc346756a89c0ea104e41d75ee752cb72 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 30 Jun 2022 12:39:10 +0200 Subject: added CPU uniform location lookup optimization --- src/render/Shader.hpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/render/Shader.hpp') 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 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 m_muUniforms; }; \ No newline at end of file -- cgit v1.2.3