summaryrefslogtreecommitdiffstats
path: root/drivers/gles3
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-08-12 11:26:23 -0500
committerRémi Verschelde <rverschelde@gmail.com>2024-09-16 16:30:06 +0200
commite1af61467a36d5d1e4a319d6fc6c3003c9f96ec2 (patch)
tree9b9bb7e8f873aa0c641a360190e9b72cc32d42bd /drivers/gles3
parentd40fc50f086d14583c7cc979ed4e5363ac223717 (diff)
downloadredot-engine-e1af61467a36d5d1e4a319d6fc6c3003c9f96ec2.tar.gz
OpenGL: Unconditionally do `glDisable(GL_FRAMEBUFFER_SRGB)` because we do our own sRGB conversion
(cherry picked from commit dfcff4ef46568216318adb37cb84c42697139ac6)
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index 37e7256d76..19ef3d416c 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -62,6 +62,10 @@
#define _EXT_DEBUG_SEVERITY_LOW_ARB 0x9148
#define _EXT_DEBUG_OUTPUT 0x92E0
+#ifndef GL_FRAMEBUFFER_SRGB
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#endif
+
#ifndef GLAPIENTRY
#if defined(WINDOWS_ENABLED)
#define GLAPIENTRY APIENTRY
@@ -345,6 +349,9 @@ RasterizerGLES3::RasterizerGLES3() {
}
}
+ // Disable OpenGL linear to sRGB conversion, because Godot will always do this conversion itself.
+ glDisable(GL_FRAMEBUFFER_SRGB);
+
// OpenGL needs to be initialized before initializing the Rasterizers
config = memnew(GLES3::Config);
utilities = memnew(GLES3::Utilities);