Bug 1326367 - Fix FakeVertex0 and enable emulation for OSX+NV+Core profiles. - r=ethlin

MozReview-Commit-ID: IafpirHZroB
This commit is contained in:
Jeff Gilbert 2016-12-29 21:44:51 -08:00
Родитель 5f768aaee3
Коммит a43611a6e8
2 изменённых файлов: 16 добавлений и 17 удалений

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

@ -1029,25 +1029,26 @@ WebGLContext::WhatDoesVertexAttrib0Need() const
const auto& isAttribArray0Enabled = mBoundVertexArray->mAttribs[0].mEnabled;
// work around Mac OSX crash, see bug 631420
bool legacyAttrib0 = gl->IsCompatibilityProfile();
#ifdef XP_MACOSX
if (gl->WorkAroundDriverBugs() &&
isAttribArray0Enabled &&
!mBufferFetch_IsAttrib0Active)
{
return WebGLVertexAttrib0Status::EmulatedUninitializedArray;
if (gl->WorkAroundDriverBugs()) {
// Failures in conformance/attribs/gl-disabled-vertex-attrib.
// Even in Core profiles on NV. Sigh.
legacyAttrib0 |= (gl->Vendor() == gl::GLVendor::NVIDIA);
}
#endif
if (MOZ_LIKELY(!gl->IsCompatibilityProfile() ||
isAttribArray0Enabled))
{
if (!legacyAttrib0)
return WebGLVertexAttrib0Status::Default;
}
return mBufferFetch_IsAttrib0Active
? WebGLVertexAttrib0Status::EmulatedInitializedArray
: WebGLVertexAttrib0Status::EmulatedUninitializedArray;
if (isAttribArray0Enabled && mBufferFetch_IsAttrib0Active)
return WebGLVertexAttrib0Status::Default;
if (mBufferFetch_IsAttrib0Active)
return WebGLVertexAttrib0Status::EmulatedInitializedArray;
// Ensure that the legacy code has enough buffer.
return WebGLVertexAttrib0Status::EmulatedUninitializedArray;
}
bool
@ -1070,6 +1071,8 @@ WebGLContext::DoFakeVertexAttrib0(const char* funcName, GLuint vertexCount)
mAlreadyWarnedAboutFakeVertexAttrib0 = true;
}
gl->fEnableVertexAttribArray(0);
if (!mFakeVertexAttrib0BufferObject) {
gl->fGenBuffers(1, &mFakeVertexAttrib0BufferObject);
mFakeVertexAttrib0BufferObjectSize = 0;

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

@ -536,10 +536,6 @@ WebGLContext::InitAndValidateGL(FailureReason* const out_failReason)
MakeContextCurrent();
// For OpenGL compat. profiles, we always keep vertex attrib 0 array enabled.
if (gl->IsCompatibilityProfile())
gl->fEnableVertexAttribArray(0);
if (MinCapabilityMode())
mGLMaxVertexAttribs = MINVALUE_GL_MAX_VERTEX_ATTRIBS;
else