Bug 1394265 - Set MAX_COMBINED_TEXTURE_IMAGE_UNITS to 0 if GetIntegeriv fails. r=daoshengmu

MozReview-Commit-ID: 6VDKmtVPrVO
This commit is contained in:
Jeff Gilbert 2017-10-09 14:28:39 -04:00
Родитель 373aeee3ba
Коммит da2ce929ea
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -513,10 +513,10 @@ WebGLContext::InitAndValidateGL(FailureReason* const out_failReason)
// Note: GL_MAX_TEXTURE_UNITS is fixed at 4 for most desktop hardware,
// even though the hardware supports much more. The
// GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS value is the accurate value.
gl->GetUIntegerv(LOCAL_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &mGLMaxTextureUnits);
mGLMaxCombinedTextureImageUnits = mGLMaxTextureUnits;
mGLMaxCombinedTextureImageUnits = gl->GetIntAs<GLuint>(LOCAL_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
mGLMaxTextureUnits = mGLMaxCombinedTextureImageUnits;
if (mGLMaxTextureUnits < 8) {
if (mGLMaxCombinedTextureImageUnits < 8) {
const nsPrintfCString reason("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: %u is < 8!",
mGLMaxTextureUnits);
*out_failReason = { "FEATURE_FAILURE_WEBGL_T_UNIT", reason };