From 44fef9a928bdce9d6246d2941b9161bd75a66c6c Mon Sep 17 00:00:00 2001 From: Stephen White Date: Thu, 28 Jan 2021 15:21:15 +0000 Subject: [PATCH] Don't enable GL_FRAMEBUFFER_SRGB on OpenGL ES. This enum value is not supported, but the functionality is implied. Silences a GL error from ANGLE. Change-Id: Ib3eb242c53d548f7b9648f7037c3178705cbaecd Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38800 Reviewed-by: Stephen White Commit-Queue: Stephen White --- src/dawn_native/opengl/BackendGL.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dawn_native/opengl/BackendGL.cpp b/src/dawn_native/opengl/BackendGL.cpp index afa9c9be7b..ac1c67f3d1 100644 --- a/src/dawn_native/opengl/BackendGL.cpp +++ b/src/dawn_native/opengl/BackendGL.cpp @@ -167,9 +167,11 @@ namespace dawn_native { namespace opengl { mFunctions.Enable(GL_SCISSOR_TEST); mFunctions.Enable(GL_PRIMITIVE_RESTART_FIXED_INDEX); if (mFunctions.GetVersion().IsDesktop()) { + // These are not necessary on GLES. The functionality is enabled by default, and + // works by specifying sample counts and SRGB textures, respectively. mFunctions.Enable(GL_MULTISAMPLE); + mFunctions.Enable(GL_FRAMEBUFFER_SRGB); } - mFunctions.Enable(GL_FRAMEBUFFER_SRGB); mFunctions.Enable(GL_SAMPLE_MASK); mPCIInfo.name = reinterpret_cast(mFunctions.GetString(GL_RENDERER));