From 11f5e6cf96a715a25b6dcb6c674f8b9219e77666 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 29 Oct 2015 14:22:13 +0800 Subject: [PATCH] setGLProgramState should not modify state block --- cocos/3d/CCMesh.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp index 5d79a10e97..c6e81189ec 100644 --- a/cocos/3d/CCMesh.cpp +++ b/cocos/3d/CCMesh.cpp @@ -404,6 +404,8 @@ void Mesh::setGLProgramState(GLProgramState* glProgramState) { // XXX create dummy texture auto material = Material::createWithGLStateProgram(glProgramState); + if (_material) + material->setStateBlock(_material->getStateBlock()); setMaterial(material); }