diff --git a/CHANGELOG b/CHANGELOG index c76bad7e33..fe1e346007 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ cocos2d-x-3.0final ?.? ? [FIX] Particles: Crash was triggered if there is not `textureFileName`section in particle plist file. [FIX] Renderer: QuadCommand::init() does not copy the Quads, it only store a reference making the code faster [FIX] Renderer: Performance improved in Sprite and SpriteBatchNode (and subclasses) sprites in about 20% + [FIX] Renderer: When note using VAO, call glBufferData() instead of glBufferSubData(). [FIX] Sprite: removed _hasChildren optimization. It uses !_children.empty() now which is super fast as well [FIX] Tests: TestCpp works with CMake on Windows. [FIX] Tests: Sprites Performance Test has 4 new tests diff --git a/cocos/2d/CCConfiguration.cpp b/cocos/2d/CCConfiguration.cpp index a576532ade..ddbc3cfae9 100644 --- a/cocos/2d/CCConfiguration.cpp +++ b/cocos/2d/CCConfiguration.cpp @@ -146,7 +146,7 @@ void Configuration::gatherGPUInfo() _supportsShareableVAO = checkForGLExtension("vertex_array_object"); _valueDict["gl.supports_vertex_array_object"] = Value(_supportsShareableVAO); - + CHECK_GL_ERROR_DEBUG(); } diff --git a/cocos/2d/renderer/CCQuadCommand.h b/cocos/2d/renderer/CCQuadCommand.h index b21999ea58..1837919c8d 100644 --- a/cocos/2d/renderer/CCQuadCommand.h +++ b/cocos/2d/renderer/CCQuadCommand.h @@ -56,7 +56,7 @@ public: //TODO use material to decide if it is translucent inline bool isTranslucent() const { return true; } - inline int32_t getMaterialID() const { return _materialID; } + inline uint32_t getMaterialID() const { return _materialID; } inline GLuint getTextureID() const { return _textureID; } @@ -71,7 +71,7 @@ public: inline const kmMat4& getModelView() const { return _mv; } protected: - int32_t _materialID; + uint32_t _materialID; //Key Data int _viewport; /// Which view port it belongs to diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 15da8cfbdd..3ffa5b583a 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -249,7 +249,7 @@ void Renderer::render() //Batch quads if(_numQuads + cmdQuadCount > VBO_SIZE) { - CCASSERT(cmdQuadCount < VBO_SIZE, "VBO is not big enough for quad data, please break the quad data down or use customized render command"); + CCASSERT(cmdQuadCount>=0 && cmdQuadCountgetType() == RenderCommand::Type::QUAD_COMMAND) diff --git a/cocos/2d/renderer/CCRenderer.h b/cocos/2d/renderer/CCRenderer.h index c2dcdccc6f..a856d201c3 100644 --- a/cocos/2d/renderer/CCRenderer.h +++ b/cocos/2d/renderer/CCRenderer.h @@ -42,7 +42,7 @@ typedef std::vector RenderQueue; struct RenderStackElement { int renderQueueID; - size_t currentIndex; + ssize_t currentIndex; }; class Renderer @@ -86,10 +86,10 @@ protected: std::stack _renderStack; std::vector _renderGroups; - int _lastMaterialID; + uint32_t _lastMaterialID; - size_t _firstCommand; - size_t _lastCommand; + ssize_t _firstCommand; + ssize_t _lastCommand; V3F_C4B_T2F_Quad _quads[VBO_SIZE]; GLushort _indices[6 * VBO_SIZE]; diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 19f7d54048..eea6c483c8 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -391,7 +391,7 @@ void Console::commandTextures(int fd, const char *command) { Scheduler *sched = Director::getInstance()->getScheduler(); sched->performFunctionInCocosThread( [&](){ - mydprintf(fd, "%s", TextureCache::getInstance()->getCachedTextureInfo().c_str()); + mydprintf(fd, "%s", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } ); }