Commit 7ee24229 by Peng Huang Committed by Commit Bot

Reland "Fix two issues with GLES2 devices"

This is a reland of c0ed204d Original change's description: > 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/+/2733268 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Peng Huang <penghuang@chromium.org> Bug: chromium:1167731 Change-Id: Iccd7b0986c4728e362fccaeda6fbeff2860d888c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743665Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
parent b27740f3
...@@ -705,7 +705,10 @@ Framebuffer::Framebuffer(const Caps &caps, ...@@ -705,7 +705,10 @@ Framebuffer::Framebuffer(const Caps &caps,
{ {
mDirtyColorAttachmentBindings.emplace_back(this, DIRTY_BIT_COLOR_ATTACHMENT_0 + colorIndex); 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) Framebuffer::Framebuffer(const Context *context, egl::Surface *surface, egl::Surface *readSurface)
......
...@@ -660,11 +660,16 @@ void GenerateCaps(const FunctionsGL *functions, ...@@ -660,11 +660,16 @@ void GenerateCaps(const FunctionsGL *functions,
if (functions->isAtLeastGL(gl::Version(3, 0)) || if (functions->isAtLeastGL(gl::Version(3, 0)) ||
functions->hasGLExtension("GL_EXT_framebuffer_object") || 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->maxRenderbufferSize = QuerySingleGLInt(functions, GL_MAX_RENDERBUFFER_SIZE);
caps->maxColorAttachments = QuerySingleGLInt(functions, GL_MAX_COLOR_ATTACHMENTS); 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 else
{ {
// Can't support ES2 without framebuffers and renderbuffers // 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