Don't enable/disable non-existant GL_FRAMEBUFFER_SRGB on OpenGL ES.

This commit is contained in:
binary1248 2023-11-13 06:08:36 +01:00 committed by Lukas Dürrenberger
parent 5b60905689
commit 2495a9ba67

View File

@ -655,6 +655,9 @@ void RenderTarget::applyShader(const Shader* shader)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void RenderTarget::setupDraw(bool useVertexCache, const RenderStates& states) void RenderTarget::setupDraw(bool useVertexCache, const RenderStates& states)
{ {
// GL_FRAMEBUFFER_SRGB is not available on OpenGL ES
// If a framebuffer supports sRGB, it will always be enabled on OpenGL ES
#ifndef SFML_OPENGL_ES
// Enable or disable sRGB encoding // Enable or disable sRGB encoding
// This is needed for drivers that do not check the format of the surface drawn to before applying sRGB conversion // This is needed for drivers that do not check the format of the surface drawn to before applying sRGB conversion
if (!m_cache.enable) if (!m_cache.enable)
@ -664,6 +667,7 @@ void RenderTarget::setupDraw(bool useVertexCache, const RenderStates& states)
else else
glCheck(glDisable(GL_FRAMEBUFFER_SRGB)); glCheck(glDisable(GL_FRAMEBUFFER_SRGB));
} }
#endif
// First set the persistent OpenGL states if it's the very first call // First set the persistent OpenGL states if it's the very first call
if (!m_cache.glStatesSet) if (!m_cache.glStatesSet)