Bug 1184786 - Fix LastColorAttachment(). r=jgilbert

This commit is contained in:
Dan Glastonbury 2015-07-17 10:14:12 +10:00
Родитель d2b9501e76
Коммит 16d9df4f71
2 изменённых файлов: 2 добавлений и 14 удалений

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

@ -1403,10 +1403,8 @@ protected:
WebGLRefPtr<WebGLProgram> mCurrentProgram;
RefPtr<const webgl::LinkedProgramInfo> mActiveProgramLinkInfo;
uint32_t mMaxFramebufferColorAttachments;
GLenum LastColorAttachment() const {
return LOCAL_GL_COLOR_ATTACHMENT0 + mMaxFramebufferColorAttachments - 1;
return LOCAL_GL_COLOR_ATTACHMENT0 + mGLMaxColorAttachments - 1;
}
bool ValidateFramebufferTarget(GLenum target, const char* const info);

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

@ -401,15 +401,8 @@ WebGLContext::ValidateFramebufferAttachment(const WebGLFramebuffer* fb, GLenum a
return true;
}
GLenum colorAttachCount = 1;
if (IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers))
colorAttachCount = mGLMaxColorAttachments;
if (attachment >= LOCAL_GL_COLOR_ATTACHMENT0 &&
attachment < GLenum(LOCAL_GL_COLOR_ATTACHMENT0 + colorAttachCount))
{
if (attachment >= LOCAL_GL_COLOR_ATTACHMENT0 && attachment <= LastColorAttachment())
return true;
}
ErrorInvalidEnum("%s: attachment: invalid enum value 0x%x.", funcName,
attachment);
@ -1885,9 +1878,6 @@ WebGLContext::InitAndValidateGL()
}
}
// Always 1 for GLES2
mMaxFramebufferColorAttachments = 1;
if (gl->IsCompatibilityProfile()) {
// gl_PointSize is always available in ES2 GLSL, but has to be
// specifically enabled on desktop GLSL.