Excplicitly binding the buffer first avoids unnecessary implicit binds in
the buffer update code.
restart_index = 0;
}
- if(get_buffer())
+ if(Buffer *ibuf = get_buffer())
{
+ BufferAlias<ELEMENT_ARRAY_BUFFER> alias(*ibuf);
+ Bind bind_ibuf(alias, true);
+
if(dirty)
update_buffer();
- BufferAlias<ELEMENT_ARRAY_BUFFER> alias(*get_buffer());
- Bind bind_ibuf(alias, true);
-
glDrawRangeElements(prim_type, min_index, max_index, size(), data_type, reinterpret_cast<void *>(get_offset()));
}
else