Skip to content

Commit 053f281

Browse files
committed
[render] bugfixes IndexBuffer
1 parent b7b8d22 commit 053f281

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vclib/render/include/vclib/bgfx/buffers/index_buffer.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ class IndexBuffer
9999
uint stage = UINT_NULL,
100100
bgfx::Access::Enum access = bgfx::Access::Read) const
101101
{
102-
if (stage == UINT_NULL || stage >= 255) {
103-
bgfx::setIndexBuffer(mIndexBufferHandle);
104-
}
105-
else {
106-
bgfx::setBuffer(stage, mIndexBufferHandle, access);
102+
if (bgfx::isValid(mIndexBufferHandle)) {
103+
if (stage == UINT_NULL) {
104+
bgfx::setIndexBuffer(mIndexBufferHandle);
105+
}
106+
else {
107+
bgfx::setBuffer(stage, mIndexBufferHandle, access);
108+
}
107109
}
108110
}
109111

0 commit comments

Comments
 (0)