Skip to content

Commit 87c456c

Browse files
committed
fix cc.GLProgramState.apply
1 parent 0a707e9 commit 87c456c

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

cocos2d/shaders/CCGLProgramState.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ cc.UniformValue = function (uniform, glprogram) {
4343
this._glprogram = glprogram;
4444

4545
this._value = null;
46-
this._currentBoundValue = null;
4746
this._type = -1;
4847
};
4948

@@ -105,12 +104,6 @@ cc.UniformValue.prototype = {
105104
},
106105

107106
apply: function apply() {
108-
if (this._currentBoundValue === this._value
109-
&& this._type !== types.GL_CALLBACK) {
110-
return;
111-
}
112-
113-
this._currentBoundValue = this._value;
114107
switch (this._type) {
115108
case types.GL_INT:
116109
this._glprogram.setUniformLocationWith1i(this._uniform.location, this._value);
@@ -180,10 +173,7 @@ cc.GLProgramState.prototype = {
180173
}
181174

182175
for (var i = 0; i < this._uniforms.length; ++i) {
183-
var uniform = this._uniforms[i];
184-
if (uniform._currentBoundValue !== uniform._value) {
185-
uniform.apply();
186-
}
176+
this._uniforms[i].apply();
187177
}
188178
},
189179

0 commit comments

Comments
 (0)