Commit 17a4b6e7 by Qin Jiajia Committed by Angle LUCI CQ

Fix that clear-srgb-color-buffer is not correct

This change removes the limitation that syncClearState/ syncClearBufferState is only for STANDARD_GL_DESKTOP so that it works on chromeos. Test: conformance2/rendering/clear-srgb-color-buffer.html deqp/functional/gles3/fbocolorbuffer/clear.html Bug: chromium:1208297 Change-Id: I7c5fed3545f623cca3f2245c67fddaf3401388b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3010630Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
parent b73eee71
......@@ -1379,10 +1379,6 @@ bool FramebufferGL::hasEmulatedAlphaChannelTextureAttachment() const
void FramebufferGL::syncClearState(const gl::Context *context, GLbitfield mask)
{
const FunctionsGL *functions = GetFunctionsGL(context);
if (functions->standard == STANDARD_GL_DESKTOP)
{
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -1405,17 +1401,12 @@ void FramebufferGL::syncClearState(const gl::Context *context, GLbitfield mask)
{
stateManager->setFramebufferSRGBEnabled(context, !mIsDefault);
}
}
}
void FramebufferGL::syncClearBufferState(const gl::Context *context,
GLenum buffer,
GLint drawBuffer)
{
const FunctionsGL *functions = GetFunctionsGL(context);
if (functions->standard == STANDARD_GL_DESKTOP)
{
StateManagerGL *stateManager = GetStateManagerGL(context);
const angle::FeaturesGL &features = GetFeaturesGL(context);
......@@ -1446,7 +1437,6 @@ void FramebufferGL::syncClearBufferState(const gl::Context *context,
{
stateManager->setFramebufferSRGBEnabled(context, !mIsDefault);
}
}
}
bool FramebufferGL::modifyInvalidateAttachmentsForEmulatedDefaultFBO(
......
......@@ -2005,10 +2005,7 @@ angle::Result StateManagerGL::syncState(const gl::Context *context,
}
// Changing the draw framebuffer binding sometimes requires resetting srgb blending.
if (mFunctions->standard == STANDARD_GL_DESKTOP)
{
iter.setLaterBit(gl::State::DIRTY_BIT_FRAMEBUFFER_SRGB_WRITE_CONTROL_MODE);
}
// If the framebuffer is emulating RGB on top of RGBA, the color mask has to be
// updated
......@@ -2225,10 +2222,10 @@ void StateManagerGL::setFramebufferSRGBEnabledForFramebuffer(const gl::Context *
bool enabled,
const FramebufferGL *framebuffer)
{
if (mFunctions->standard == STANDARD_GL_DESKTOP && framebuffer->isDefault())
if (framebuffer->isDefault())
{
// Obey the framebuffer sRGB state for blending on all framebuffers except the default
// framebuffer on Desktop OpenGL.
// framebuffer.
// When SRGB blending is enabled, only SRGB capable formats will use it but the default
// framebuffer will always use it if it is enabled.
// TODO(geofflang): Update this when the framebuffer binding dirty changes, when it exists.
......
......@@ -1885,7 +1885,7 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
isIntel && IsApple() && IsSkylake(device) && GetMacOSVersion() < OSVersion(10, 13, 2));
ANGLE_FEATURE_CONDITION(features, doesSRGBClearsOnLinearFramebufferAttachments,
functions->standard == STANDARD_GL_DESKTOP && (isIntel || isAMD));
isIntel || isAMD);
ANGLE_FEATURE_CONDITION(features, emulateMaxVertexAttribStride,
IsLinux() && functions->standard == STANDARD_GL_DESKTOP && isAMD);
......
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