File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,20 @@ - (void) setTextureDirty
329
329
_isTextureDirty = YES ;
330
330
}
331
331
332
+ -(CCRenderState *)renderState
333
+ {
334
+ if (_renderState == nil ){
335
+ // Allowing the uniforms to be copied speeds up the rendering by making the render state immutable.
336
+ // Copy the uniforms if custom uniforms are not being used.
337
+ BOOL copyUniforms = self.hasDefaultShaderUniforms ;
338
+
339
+ // Create an uncached renderstate so the texture can be released before the renderstate cache is flushed.
340
+ _renderState = [CCRenderState renderStateWithBlendMode: _blendMode shader: _shader shaderUniforms: self .shaderUniforms copyUniforms: copyUniforms];
341
+ }
342
+
343
+ return _renderState;
344
+ }
345
+
332
346
333
347
#pragma mark -
334
348
#pragma mark Render Font Mac & iOS 6
You can’t perform that action at this time.
0 commit comments