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, ...@@ -197,7 +197,6 @@ gl::Error FramebufferGL::invalidateSub(size_t count, const GLenum *attachments,
gl::Error FramebufferGL::clear(const gl::Data &data, GLbitfield mask) gl::Error FramebufferGL::clear(const gl::Data &data, GLbitfield mask)
{ {
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clear(mask); mFunctions->clear(mask);
...@@ -206,7 +205,6 @@ gl::Error FramebufferGL::clear(const gl::Data &data, GLbitfield 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) gl::Error FramebufferGL::clearBufferfv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLfloat *values)
{ {
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferfv(buffer, drawbuffer, values); mFunctions->clearBufferfv(buffer, drawbuffer, values);
...@@ -215,7 +213,6 @@ gl::Error FramebufferGL::clearBufferfv(const gl::State &state, GLenum buffer, GL ...@@ -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) gl::Error FramebufferGL::clearBufferuiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLuint *values)
{ {
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferuiv(buffer, drawbuffer, values); mFunctions->clearBufferuiv(buffer, drawbuffer, values);
...@@ -224,7 +221,6 @@ gl::Error FramebufferGL::clearBufferuiv(const gl::State &state, GLenum buffer, G ...@@ -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) gl::Error FramebufferGL::clearBufferiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLint *values)
{ {
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferiv(buffer, drawbuffer, values); mFunctions->clearBufferiv(buffer, drawbuffer, values);
...@@ -233,7 +229,6 @@ gl::Error FramebufferGL::clearBufferiv(const gl::State &state, GLenum buffer, GL ...@@ -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) gl::Error FramebufferGL::clearBufferfi(const gl::State &state, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
{ {
syncClearState();
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil); mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil);
...@@ -295,13 +290,4 @@ GLuint FramebufferGL::getFramebufferID() const ...@@ -295,13 +290,4 @@ GLuint FramebufferGL::getFramebufferID() const
return mFramebufferID; 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 ...@@ -60,8 +60,6 @@ class FramebufferGL : public FramebufferImpl
GLuint getFramebufferID() const; GLuint getFramebufferID() const;
private: private:
void syncClearState();
const FunctionsGL *mFunctions; const FunctionsGL *mFunctions;
StateManagerGL *mStateManager; StateManagerGL *mStateManager;
......
...@@ -90,7 +90,6 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren ...@@ -90,7 +90,6 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mClearColor(0.0f, 0.0f, 0.0f, 0.0f), mClearColor(0.0f, 0.0f, 0.0f, 0.0f),
mClearDepth(1.0f), mClearDepth(1.0f),
mClearStencil(0), mClearStencil(0),
mFramebufferSRGBEnabled(false),
mTextureCubemapSeamlessEnabled(false), mTextureCubemapSeamlessEnabled(false),
mLocalDirtyBits() mLocalDirtyBits()
{ {
...@@ -506,16 +505,6 @@ gl::Error StateManagerGL::setGenericDrawState(const gl::Data &data) ...@@ -506,16 +505,6 @@ gl::Error StateManagerGL::setGenericDrawState(const gl::Data &data)
const FramebufferGL *framebufferGL = GetImplAs<FramebufferGL>(framebuffer); const FramebufferGL *framebufferGL = GetImplAs<FramebufferGL>(framebuffer);
bindFramebuffer(GL_DRAW_FRAMEBUFFER, framebufferGL->getFramebufferID()); 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. // Seamless cubemaps are required for ES3 and higher contexts.
setTextureCubemapSeamlessEnabled(data.clientVersion >= 3); setTextureCubemapSeamlessEnabled(data.clientVersion >= 3);
...@@ -1236,22 +1225,6 @@ void StateManagerGL::syncState(const gl::State &state, const gl::State::DirtyBit ...@@ -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) void StateManagerGL::setTextureCubemapSeamlessEnabled(bool enabled)
{ {
if (mTextureCubemapSeamlessEnabled != enabled) if (mTextureCubemapSeamlessEnabled != enabled)
......
...@@ -109,8 +109,6 @@ class StateManagerGL final : angle::NonCopyable ...@@ -109,8 +109,6 @@ class StateManagerGL final : angle::NonCopyable
GLint skipPixels, GLint skipPixels,
GLuint packBuffer); GLuint packBuffer);
void setFramebufferSRGBEnabled(bool enabled);
gl::Error setDrawArraysState(const gl::Data &data, gl::Error setDrawArraysState(const gl::Data &data,
GLint first, GLint first,
GLsizei count, GLsizei count,
...@@ -215,7 +213,6 @@ class StateManagerGL final : angle::NonCopyable ...@@ -215,7 +213,6 @@ class StateManagerGL final : angle::NonCopyable
float mClearDepth; float mClearDepth;
GLint mClearStencil; GLint mClearStencil;
bool mFramebufferSRGBEnabled;
bool mTextureCubemapSeamlessEnabled; bool mTextureCubemapSeamlessEnabled;
gl::State::DirtyBits mLocalDirtyBits; 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