Commit c0ed204d by Peng Huang Committed by Commit Bot

Fix two issues with GLES2 devices

* make sure maxColorAttachments is greater than 0 * Do not sync read buffer if maxDrawBuffers is 0 Bug: chromium:1167731 Change-Id: Icd0fb5e65ec6ffdc0d6f6325ccd1207958922254 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2733268Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
parent a272a8ac
......@@ -705,7 +705,10 @@ Framebuffer::Framebuffer(const Caps &caps,
{
mDirtyColorAttachmentBindings.emplace_back(this, DIRTY_BIT_COLOR_ATTACHMENT_0 + colorIndex);
}
mDirtyBits.set(DIRTY_BIT_READ_BUFFER);
if (caps.maxDrawBuffers > 1)
{
mDirtyBits.set(DIRTY_BIT_READ_BUFFER);
}
}
Framebuffer::Framebuffer(const Context *context, egl::Surface *surface, egl::Surface *readSurface)
......
......@@ -638,11 +638,16 @@ void GenerateCaps(const FunctionsGL *functions,
if (functions->isAtLeastGL(gl::Version(3, 0)) ||
functions->hasGLExtension("GL_EXT_framebuffer_object") ||
functions->isAtLeastGLES(gl::Version(2, 0)))
functions->isAtLeastGLES(gl::Version(3, 0)))
{
caps->maxRenderbufferSize = QuerySingleGLInt(functions, GL_MAX_RENDERBUFFER_SIZE);
caps->maxColorAttachments = QuerySingleGLInt(functions, GL_MAX_COLOR_ATTACHMENTS);
}
else if (functions->isAtLeastGLES(gl::Version(2, 0)))
{
caps->maxRenderbufferSize = QuerySingleGLInt(functions, GL_MAX_RENDERBUFFER_SIZE);
caps->maxColorAttachments = 1;
}
else
{
// Can't support ES2 without framebuffers and renderbuffers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment