The GL implementation doesn’t seem to handle sRGB framebuffers correctly. If you ask for a default framebuffer with sRGB encoding (GL_FRAMEBUFFER_SRGB_CAPABLE_ARB, GLFW_SRGB_CAPABLE, SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, etc) the framebuffer you are given does not appear to be sRGB. If you query for GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING it will always return GL_LINEAR, not GL_SRGB like you would expect. Secondly, if you enable GL_FRAMEBUFFER_SRGB then you will get sRGB conversion happening regardless of whether or not you specify the framebuffer to be sRGB. The correct behavior is for sRGB conversion to take place only if GL_FRAMEBUFFER_SRGB is enabled and the framebuffer format is sRGB.
I can only test this on 340.76 at the moment but I suspect this effects all versions. Frankly I am really surprised that this hasn’t been caught already.
WGLTestSRGB.cpp (6.63 KB)