From 384041a9500963514a1055b0b50f1accaede7e40 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Mon, 18 May 2015 10:31:17 +0800 Subject: [PATCH] improve the perfermance of clear background for camera --- cocos/2d/CCCamera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index d72d2c8053..2659dd9c64 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -396,7 +396,7 @@ void Camera::clearBackground(float depth) quad.tr.texCoords = Tex2F(1,1); auto shader = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_CAMERA_CLEAR); - auto programState = GLProgramState::create(shader); + auto programState = GLProgramState::getOrCreateWithGLProgram(shader); programState->setUniformFloat("depth", 1.0); programState->apply(Mat4()); GLshort indices[6] = {0, 1, 2, 3, 2, 1};