зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
903e6345cc
Коммит
ba6b22640d
|
@ -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();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче