glBindBufferRange should only be called if the buffer range bound to that
index was changed. The buffer binding gets changed as a side-effect, but
should not factor into the decision.
{
if(t!=buffer.type)
Buffer::require_buffer_type(t);
{
if(t!=buffer.type)
Buffer::require_buffer_type(t);
- // Intentionally using bitwise | to avoid short-circuiting
- if(Buffer::set_current(t, &buffer) | set_current(t, i, this))
+ if(set_current(t, i, this))
+ {
+ // The buffer gets bound as a side effect
+ Buffer::set_current(t, &buffer);
glBindBufferRange(t, i, buffer.id, offset, size);
glBindBufferRange(t, i, buffer.id, offset, size);
}
void BufferRange::unbind_from(BufferType t, unsigned i)
}
void BufferRange::unbind_from(BufferType t, unsigned i)