Bug 1309643 - Only enable primitive restart index on OSX for DrawElements. - r=ethlin

This commit is contained in:
Jeff Gilbert 2016-12-16 16:17:29 -08:00
Родитель 3af5047314
Коммит 4fe7340dc2
3 изменённых файлов: 6 добавлений и 6 удалений

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

@ -175,7 +175,6 @@ WebGLContext::InitWebGL2(FailureReason* const out_failReason)
gl->fEnable(LOCAL_GL_PRIMITIVE_RESTART_FIXED_INDEX);
} else {
MOZ_ASSERT(gl->IsSupported(gl::GLFeature::prim_restart));
gl->fEnable(LOCAL_GL_PRIMITIVE_RESTART);
}
//////

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

@ -270,11 +270,11 @@ WebGLContext::DrawArrays_check(const char* funcName, GLenum mode, GLint first,
if (IsWebGL2() && !gl->IsSupported(gl::GLFeature::prim_restart_fixed)) {
MOZ_ASSERT(gl->IsSupported(gl::GLFeature::prim_restart));
if (mPrimRestartTypeBytes != 4) {
mPrimRestartTypeBytes = 4;
if (mPrimRestartTypeBytes != 0) {
mPrimRestartTypeBytes = 0;
// OSX has issues leaving this as 0.
gl->fPrimitiveRestartIndex(UINT32_MAX);
// OSX appears to have severe perf issues with leaving this enabled.
gl->fDisable(LOCAL_GL_PRIMITIVE_RESTART);
}
}
@ -630,6 +630,7 @@ WebGLContext::DrawElements_check(const char* funcName, GLenum mode, GLsizei vert
mPrimRestartTypeBytes = bytesPerElem;
const uint32_t ones = UINT32_MAX >> (4 - mPrimRestartTypeBytes);
gl->fEnable(LOCAL_GL_PRIMITIVE_RESTART);
gl->fPrimitiveRestartIndex(ones);
}
}

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

@ -445,7 +445,7 @@ static const FeatureInfo sFeatureInfoArr[] = {
GLESVersion::NONE,
GLContext::Extension_None,
{
GLContext::NV_primitive_restart,
//GLContext::NV_primitive_restart, // Has different enum values.
GLContext::Extensions_End
}
},