This commit is contained in:
halx99 2022-03-13 12:05:22 +08:00
parent a435a3a224
commit 8caed810e0
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/****************************************************************************
Copyright (c) 2018-2019 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2021 Bytedance Inc.
Copyright (c) 2021-2022 Bytedance Inc.
https://adxeproject.github.io/
@ -184,7 +184,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();
@ -199,6 +199,7 @@ void CommandBufferGL::setVertexBuffer(Buffer* buffer)
return;
buffer->retain();
CC_SAFE_RELEASE(_vertexBuffer);
_vertexBuffer = static_cast<BufferGL*>(buffer);
}

View File

@ -1,5 +1,6 @@
/****************************************************************************
Copyright (c) 2018-2019 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2022 Bytedance Inc.
https://adxeproject.github.io/