Commit 260efc21 by Geoff Lang

Revert "Explicitly enable framebuffer SRGB blending in StateManagerGL."

Causing failures on AMD OpenGL drivers for sRGB clears. This reverts commit 04b89c97. Change-Id: I51ee856d1c4d37882e5b1d1926415c398fa7ff5c Reviewed-on: https://chromium-review.googlesource.com/301721Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 6d246510
......@@ -197,7 +197,6 @@ gl::Error FramebufferGL::invalidateSub(size_t count, const GLenum *attachments,
gl::Error FramebufferGL::clear(const gl::Data &data, GLbitfield mask)
{
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clear(mask);
......@@ -206,7 +205,6 @@ gl::Error FramebufferGL::clear(const gl::Data &data, GLbitfield mask)
gl::Error FramebufferGL::clearBufferfv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLfloat *values)
{
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferfv(buffer, drawbuffer, values);
......@@ -215,7 +213,6 @@ gl::Error FramebufferGL::clearBufferfv(const gl::State &state, GLenum buffer, GL
gl::Error FramebufferGL::clearBufferuiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLuint *values)
{
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferuiv(buffer, drawbuffer, values);
......@@ -224,7 +221,6 @@ gl::Error FramebufferGL::clearBufferuiv(const gl::State &state, GLenum buffer, G
gl::Error FramebufferGL::clearBufferiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLint *values)
{
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferiv(buffer, drawbuffer, values);
......@@ -233,7 +229,6 @@ gl::Error FramebufferGL::clearBufferiv(const gl::State &state, GLenum buffer, GL
gl::Error FramebufferGL::clearBufferfi(const gl::State &state, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
{
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil);
......@@ -295,13 +290,4 @@ GLuint FramebufferGL::getFramebufferID() const
return mFramebufferID;
}
void FramebufferGL::syncClearState()
{
if (mFunctions->standard == STANDARD_GL_DESKTOP)
{
// TODO(geofflang): Update this when the framebuffer binding dirty changes, when it exists
// (see StateManagerGL.cpp)
mStateManager->setFramebufferSRGBEnabled(mFramebufferID != 0);
}
}
}
......@@ -60,8 +60,6 @@ class FramebufferGL : public FramebufferImpl
GLuint getFramebufferID() const;
private:
void syncClearState();
const FunctionsGL *mFunctions;
StateManagerGL *mStateManager;
......
......@@ -90,7 +90,6 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mClearColor(0.0f, 0.0f, 0.0f, 0.0f),
mClearDepth(1.0f),
mClearStencil(0),
mFramebufferSRGBEnabled(false),
mTextureCubemapSeamlessEnabled(false),
mLocalDirtyBits()
{
......@@ -506,16 +505,6 @@ gl::Error StateManagerGL::setGenericDrawState(const gl::Data &data)
const FramebufferGL *framebufferGL = GetImplAs<FramebufferGL>(framebuffer);
bindFramebuffer(GL_DRAW_FRAMEBUFFER, framebufferGL->getFramebufferID());
if (mFunctions->standard == STANDARD_GL_DESKTOP)
{
// Enable SRGB blending for all framebuffers except the default framebuffer on Desktop
// OpenGL.
// 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.
setFramebufferSRGBEnabled(framebufferGL->getFramebufferID() != 0);
}
// Seamless cubemaps are required for ES3 and higher contexts.
setTextureCubemapSeamlessEnabled(data.clientVersion >= 3);
......@@ -1236,22 +1225,6 @@ void StateManagerGL::syncState(const gl::State &state, const gl::State::DirtyBit
}
}
void StateManagerGL::setFramebufferSRGBEnabled(bool enabled)
{
if (mFramebufferSRGBEnabled != enabled)
{
mFramebufferSRGBEnabled = enabled;
if (mFramebufferSRGBEnabled)
{
mFunctions->enable(GL_FRAMEBUFFER_SRGB);
}
else
{
mFunctions->disable(GL_FRAMEBUFFER_SRGB);
}
}
}
void StateManagerGL::setTextureCubemapSeamlessEnabled(bool enabled)
{
if (mTextureCubemapSeamlessEnabled != enabled)
......
......@@ -109,8 +109,6 @@ class StateManagerGL final : angle::NonCopyable
GLint skipPixels,
GLuint packBuffer);
void setFramebufferSRGBEnabled(bool enabled);
gl::Error setDrawArraysState(const gl::Data &data,
GLint first,
GLsizei count,
......@@ -215,7 +213,6 @@ class StateManagerGL final : angle::NonCopyable
float mClearDepth;
GLint mClearStencil;
bool mFramebufferSRGBEnabled;
bool mTextureCubemapSeamlessEnabled;
gl::State::DirtyBits mLocalDirtyBits;
......
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