Bug 1156629 - OpenGL core context deprecated default VAO. r=jgilbert

Create a VAO and attach it to the default object.
This commit is contained in:
Dan Glastonbury 2015-01-29 15:29:43 +10:00 коммит произвёл Dan Glastonbury
Родитель 903e6345cc
Коммит ba6b22640d
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -1949,6 +1949,21 @@ WebGLContext::InitAndValidateGL()
mDefaultVertexArray->mAttribs.SetLength(mGLMaxVertexAttribs);
mBoundVertexArray = mDefaultVertexArray;
// OpenGL core profiles remove the default VAO object from version
// 4.0.0. We create a default VAO for all core profiles,
// regardless of version.
//
// GL Spec 4.0.0:
// (https://www.opengl.org/registry/doc/glspec40.core.20100311.pdf)
// in Section E.2.2 "Removed Features", pg 397: "[...] The default
// vertex array object (the name zero) is also deprecated. [...]"
if (gl->IsCoreProfile()) {
MakeContextCurrent();
mDefaultVertexArray->GenVertexArray();
mDefaultVertexArray->BindVertexArray();
}
if (mLoseContextOnMemoryPressure)
mContextObserver->RegisterMemoryPressureEvent();