[Improvement] (All): Better assertion.

This commit is contained in:
BZLZHH
2025-11-23 10:27:01 +08:00
parent 363bedb245
commit 9cd749b707
11 changed files with 92 additions and 77 deletions
+3 -7
View File
@@ -53,13 +53,9 @@ namespace MobileGL {
BindingSlot<BufferObject>& GLContext::GetBufferBindingSlot(BufferTarget target) {
if (target == BufferTarget::Index) {
const auto& vao = m_vertexArrayState.GetBoundVertexArray();
if (vao) {
return vao->GetIndexBufferBindingSlot();
} else {
assert(false);
static BindingSlot<BufferObject> defaultSlot(BufferTarget::Index);
return defaultSlot;
}
MOBILEGL_ASSERT(vao != nullptr,
"No VAO is currently bound when accessing index buffer binding slot.");
return vao->GetIndexBufferBindingSlot();
}
return m_bufferState.GetBindingSlot(target);