OpenGL 缓冲区和直接状态访问 (DSA) 的绑定错误

Binding error with OpenGL buffers and Direct State Access (DSA)

我在使用 glNamedBufferStorage() 时从 OpenGL 收到此错误:

GL_INVALID_OPERATION error generated. Buffer must be bound.

通常我不必使用具有直接状态访问的 glBindBuffer() !?

这是我的 gl 调用序列:

glCreateBuffers(1, &m_identifier);
...
glNamedBufferStorage(m_identifier, static_cast< GLsizeiptr >(bytes + offset), data, GL_DYNAMIC_STORAGE_BIT);
...
glNamedBufferSubData(m_identifier, static_cast< GLintptr >(offset), static_cast< GLsizeiptr >(bytes), data);

我只使用DSA函数,所以我不明白为什么会出现问题。

糟糕,我忘了这个小东西:glGetBufferParameteriv()。

在 DSA 中被 glGetNamedBufferParameteriv() 取代。

它被包装到我的 class 的方法中。