File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 57
57
// to ease the transition from using glPrograms directly, to
58
58
// using glProgramStates.
59
59
Object . defineProperty ( proto , '_shaderProgram' , {
60
- set : function ( ) { this . setShaderProgram . apply ( this , arguments ) ; } ,
60
+ set : function ( value ) { this . setShaderProgram ( value ) ; } ,
61
61
get : function ( ) { return this . getShaderProgram ( ) ; }
62
62
} ) ;
63
63
} ) ( ) ;
Original file line number Diff line number Diff line change @@ -153,7 +153,6 @@ cc.GLProgramState = function (glprogram) {
153
153
this . _boundTextureUnits = { } ;
154
154
this . _textureUnitIndex = 1 ; // Start at 1, as CC_Texture0 is bound to 0
155
155
156
-
157
156
var activeUniforms = glprogram . _glContext . getProgramParameter ( glprogram . _programObj ,
158
157
glprogram . _glContext . ACTIVE_UNIFORMS ) ;
159
158
@@ -168,7 +167,7 @@ cc.GLProgramState = function (glprogram) {
168
167
this . _uniforms . push ( uniformValue ) ;
169
168
this . _uniformsByName [ uniform . name ] = count ;
170
169
this . _uniformsByLocation [ uniform . location ] = count ;
171
- count ++ ;
170
+ count ++ ;
172
171
}
173
172
}
174
173
} ;
@@ -181,7 +180,10 @@ cc.GLProgramState.prototype = {
181
180
}
182
181
183
182
for ( var i = 0 ; i < this . _uniforms . length ; ++ i ) {
184
- this . _uniforms [ i ] . apply ( ) ;
183
+ var uniform = this . _uniforms [ i ] ;
184
+ if ( uniform . _currentBoundValue !== uniform . _value ) {
185
+ uniform . apply ( ) ;
186
+ }
185
187
}
186
188
} ,
187
189
You can’t perform that action at this time.
0 commit comments