Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cocos/renderer/backend/opengl/CommandBufferGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void CommandBufferGL::setWinding(Winding winding)
void CommandBufferGL::setIndexBuffer(Buffer* buffer)
{
assert(buffer != nullptr);
if (buffer == nullptr)
if (buffer == nullptr || _indexBuffer == buffer)
return;

buffer->retain();
Expand All @@ -345,6 +345,7 @@ void CommandBufferGL::setVertexBuffer(Buffer* buffer)
return;

buffer->retain();
CC_SAFE_RELEASE(_vertexBuffer);
_vertexBuffer = static_cast<BufferGL*>(buffer);
}

Expand Down