Commit f7417801 by Corentin Wallez Committed by Commit Bot

FramebufferGL: only work around SRGB blits on Desktop GL

BUG=angleproject:1492 Change-Id: I6c210243dffb775efd61c33160dabcbf7406a757 Reviewed-on: https://chromium-review.googlesource.com/397798Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent c1984ed4
...@@ -303,7 +303,7 @@ Error FramebufferGL::blit(ContextImpl *context, ...@@ -303,7 +303,7 @@ Error FramebufferGL::blit(ContextImpl *context,
bool sourceSRGB = bool sourceSRGB =
readAttachment != nullptr && readAttachment->getColorEncoding() == GL_SRGB; readAttachment != nullptr && readAttachment->getColorEncoding() == GL_SRGB;
needManualColorBlit = needManualColorBlit =
needManualColorBlit || (sourceSRGB && !mFunctions->isAtLeastGL(gl::Version(4, 4))); needManualColorBlit || (sourceSRGB && mFunctions->isAtMostGL(gl::Version(4, 3)));
} }
// Prior to OpenGL 4.2 BlitFramebuffer (section 4.3.2 of GL 4.1 core profile) reads: // Prior to OpenGL 4.2 BlitFramebuffer (section 4.3.2 of GL 4.1 core profile) reads:
...@@ -327,7 +327,7 @@ Error FramebufferGL::blit(ContextImpl *context, ...@@ -327,7 +327,7 @@ Error FramebufferGL::blit(ContextImpl *context,
} }
needManualColorBlit = needManualColorBlit =
needManualColorBlit || (destSRGB && !mFunctions->isAtLeastGL(gl::Version(4, 2))); needManualColorBlit || (destSRGB && mFunctions->isAtMostGL(gl::Version(4, 1)));
} }
} }
......
...@@ -2283,11 +2283,21 @@ bool FunctionsGL::isAtLeastGL(const gl::Version &glVersion) const ...@@ -2283,11 +2283,21 @@ bool FunctionsGL::isAtLeastGL(const gl::Version &glVersion) const
return standard == STANDARD_GL_DESKTOP && version >= glVersion; return standard == STANDARD_GL_DESKTOP && version >= glVersion;
} }
bool FunctionsGL::isAtMostGL(const gl::Version &glVersion) const
{
return standard == STANDARD_GL_DESKTOP && glVersion >= version;
}
bool FunctionsGL::isAtLeastGLES(const gl::Version &glesVersion) const bool FunctionsGL::isAtLeastGLES(const gl::Version &glesVersion) const
{ {
return standard == STANDARD_GL_ES && version >= glesVersion; return standard == STANDARD_GL_ES && version >= glesVersion;
} }
bool FunctionsGL::isAtMostGLES(const gl::Version &glesVersion) const
{
return standard == STANDARD_GL_ES && glesVersion >= version;
}
bool FunctionsGL::hasExtension(const std::string &ext) const bool FunctionsGL::hasExtension(const std::string &ext) const
{ {
return std::find(extensions.begin(), extensions.end(), ext) != extensions.end(); return std::find(extensions.begin(), extensions.end(), ext) != extensions.end();
......
...@@ -36,7 +36,9 @@ class FunctionsGL ...@@ -36,7 +36,9 @@ class FunctionsGL
StandardGL standard; StandardGL standard;
GLint profile; GLint profile;
bool isAtLeastGL(const gl::Version &glVersion) const; bool isAtLeastGL(const gl::Version &glVersion) const;
bool isAtMostGL(const gl::Version &glVersion) const;
bool isAtLeastGLES(const gl::Version &glesVersion) const; bool isAtLeastGLES(const gl::Version &glesVersion) const;
bool isAtMostGLES(const gl::Version &glesVersion) const;
// Extensions // Extensions
std::vector<std::string> extensions; std::vector<std::string> extensions;
......
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