Commit a3d333c2 by Frank Henigman Committed by Commit Bot

Don't enable/disable sRGB on GLES.

glEnable/glDisable GL_FRAMEBUFFER_SRGB isn't meaningful on GLES. BUG=angleproject:1300 Change-Id: I0afd697ed9770e2eb1cdcc851884b90de1a4583c Reviewed-on: https://chromium-review.googlesource.com/334490Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
parent 5051eee5
......@@ -336,24 +336,27 @@ void FramebufferGL::syncDrawState() const
void FramebufferGL::syncClearState(GLbitfield mask)
{
if (mWorkarounds.doesSRGBClearsOnLinearFramebufferAttachments &&
(mask & GL_COLOR_BUFFER_BIT) != 0 && !mIsDefault)
if (mFunctions->standard == STANDARD_GL_DESKTOP)
{
bool hasSRBAttachment = false;
for (const auto &attachment : mData.getColorAttachments())
if (mWorkarounds.doesSRGBClearsOnLinearFramebufferAttachments &&
(mask & GL_COLOR_BUFFER_BIT) != 0 && !mIsDefault)
{
if (attachment.isAttached() && attachment.getColorEncoding() == GL_SRGB)
bool hasSRBAttachment = false;
for (const auto &attachment : mData.getColorAttachments())
{
hasSRBAttachment = true;
break;
if (attachment.isAttached() && attachment.getColorEncoding() == GL_SRGB)
{
hasSRBAttachment = true;
break;
}
}
}
mStateManager->setFramebufferSRGBEnabled(hasSRBAttachment);
}
else
{
mStateManager->setFramebufferSRGBEnabled(!mIsDefault);
mStateManager->setFramebufferSRGBEnabled(hasSRBAttachment);
}
else
{
mStateManager->setFramebufferSRGBEnabled(!mIsDefault);
}
}
}
......
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