diff options
author | Dmitry Kunin <dkunin@mapswith.me> | 2014-01-08 17:53:46 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:09:54 +0300 |
commit | 358be7c9999ac35ca6e6b503fa773c19187a6ee4 (patch) | |
tree | 91ac8cd403bb3b59c412624fb8bf777598281b3a /drape/gpu_program.hpp | |
parent | 90e74463d9e2fc10fd359973413421432490a0f3 (diff) |
[gl] Uniform validator.
Diffstat (limited to 'drape/gpu_program.hpp')
-rw-r--r-- | drape/gpu_program.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drape/gpu_program.hpp b/drape/gpu_program.hpp index 99668b65bb..9588d5bbb4 100644 --- a/drape/gpu_program.hpp +++ b/drape/gpu_program.hpp @@ -2,8 +2,13 @@ #include "shader.hpp" #include "pointers.hpp" +#include "glconstants.hpp" #include "../std/string.hpp" +#include "../std/map.hpp" +#include "../std/scoped_ptr.hpp" + +class UniformValidator; class GpuProgram { @@ -21,4 +26,22 @@ public: private: uint32_t m_programID; + + scoped_ptr<UniformValidator> m_validator; +}; + +class UniformValidator +{ +private: + typedef int32_t UniformSize; + typedef pair<glConst, UniformSize> UniformTypeAndSize; + + uint32_t m_programID; + map<string, UniformTypeAndSize> m_uniformsMap; + +public: + UniformValidator(uint32_t programId); + + bool HasUniform(string const & name); + bool HasValidTypeAndSizeForName(string const & name, glConst type, UniformSize size); }; |