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:
committed by
Dan Glastonbury
parent
d5fe151649
commit
d9057155ea
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user