Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Hardware/Video/Shaders/Headers/ShaderProgram.h

Diff revisions: vs.
  @@ -57,6 +57,9 @@
57 57 virtual void Uniform(const std::string& ext, const mat4<F32>& value, bool rowMajor = false) = 0;
58 58 virtual void Uniform(const std::string& ext, const vectorImpl<I32 >& values) = 0;
59 59 virtual void Uniform(const std::string& ext, const vectorImpl<F32 >& values) = 0;
60 + virtual void Uniform(const std::string& ext, const vectorImpl<vec2<F32> >& values) = 0;
61 + virtual void Uniform(const std::string& ext, const vectorImpl<vec3<F32> >& values) = 0;
62 + virtual void Uniform(const std::string& ext, const vectorImpl<vec4<F32> >& values) = 0;
60 63 virtual void Uniform(const std::string& ext, const vectorImpl<mat4<F32> >& values, bool rowMajor = false) = 0;
61 64 ///Uniform Texture
62 65 virtual void UniformTexture(const std::string& ext, U16 slot) = 0;
  @@ -73,9 +76,12 @@
73 76 void recompile(const bool vertex, const bool fragment, const bool geometry = false, const bool tessellation = false);
74 77 //calling refresh will force an update on default shader uniforms
75 78 void refresh() {_dirty = true;}
76 -
79 + //add global shader defines
77 80 inline void addShaderDefine(const std::string& define) {_definesList.push_back(define);}
78 81 void removeShaderDefine(const std::string& define);
82 + //add either fragment or vertex uniforms (without the "uniform" word. e.g. addShaderUniform("vec3 eyePos", VERTEX_SHADER);)
83 + void addShaderUniform(const std::string& uniform, const ShaderType& type);
84 + void removeUniform(const std::string& uniform, const ShaderType& type);
79 85
80 86 inline void setShaderMask(const P32 mask) {
81 87 _useVertex = (mask.b.b0 == 1);
  @@ -123,7 +129,6 @@
123 129 boost::atomic_bool _bound;
124 130 boost::atomic_bool _compiled;
125 131 U32 _shaderProgramId; //<not thread-safe. Make sure assignment is protected with a mutex or something
126 - U32 _invalidShaderProgramId;
127 132 I32 _maxCombinedTextureUnits;
128 133 /**Skip or include certain matrices. Can change at any time:
129 134 /*b0 = normal_matrix
  @@ -133,10 +138,17 @@
133 138 P32 _matrixMask;
134 139 ///A list of preprocessor defines
135 140 vectorImpl<std::string > _definesList;
141 + ///A list of vertex shader uniforms
142 + vectorImpl<std::string > _vertUniforms;
143 + ///A list of fragment shader uniforms
144 + vectorImpl<std::string > _fragUniforms;
136 145 ///ID<->shaders pair
137 146 typedef Unordered_map<U32, Shader* > ShaderIdMap;
138 147 ShaderIdMap _shaderIdMap;
139 -
148 + ///cached clipping planes
149 + vectorImpl<vec4<F32> > _clipPlanes;
150 + ///cached clippin planes' states
151 + vectorImpl<I32 > _clipPlanesStates;
140 152 private:
141 153 ///Small hack to avoid stack allocations
142 154 mat4<F32> _cachedMatrix;