[Scummvm-git-logs] scummvm branch-2-8 -> ecac2b54a86c80675db443dd08b9559d2ac5961b

lephilousophe noreply at scummvm.org
Sun Jan 28 16:14:12 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ecac2b54a8 GRAPHICS: OPENGL: Don't try to use GLAD aliasing for shaders


Commit: ecac2b54a86c80675db443dd08b9559d2ac5961b
    https://github.com/scummvm/scummvm/commit/ecac2b54a86c80675db443dd08b9559d2ac5961b
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-01-28T17:13:59+01:00

Commit Message:
GRAPHICS: OPENGL: Don't try to use GLAD aliasing for shaders

Aliasing doesn't cover all the functions we use.
In addition, old GLSL 1.00 doesn't support the #version stance.

Changed paths:
    NEWS.md
    graphics/opengl/context.cpp
    graphics/opengl/shader.cpp


diff --git a/NEWS.md b/NEWS.md
index c78e5d18823..a6f48187ffc 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,6 +5,7 @@ For a more comprehensive changelog of the latest experimental code, see:
 
  General:
    - Fixed GLSL version parsing on some OpenGL ES2 platforms.
+   - Don't try to use shaders on old OpenGL implementations.
 
  Broken Sword 2:
    - Fixed crash when quitting the game while it was paused.
diff --git a/graphics/opengl/context.cpp b/graphics/opengl/context.cpp
index 3597812611e..e2f83cdf311 100644
--- a/graphics/opengl/context.cpp
+++ b/graphics/opengl/context.cpp
@@ -169,10 +169,6 @@ void Context::initialize(ContextType contextType) {
 		extString = "";
 	}
 
-	bool ARBShaderObjects = false;
-	bool ARBShadingLanguage100 = false;
-	bool ARBVertexShader = false;
-	bool ARBFragmentShader = false;
 	bool EXTFramebufferMultisample = false;
 	bool EXTFramebufferBlit = false;
 
@@ -182,14 +178,6 @@ void Context::initialize(ContextType contextType) {
 
 		if (token == "GL_ARB_texture_non_power_of_two" || token == "GL_OES_texture_npot") {
 			NPOTSupported = true;
-		} else if (token == "GL_ARB_shader_objects") {
-			ARBShaderObjects = true;
-		} else if (token == "GL_ARB_shading_language_100") {
-			ARBShadingLanguage100 = true;
-		} else if (token == "GL_ARB_vertex_shader") {
-			ARBVertexShader = true;
-		} else if (token == "GL_ARB_fragment_shader") {
-			ARBFragmentShader = true;
 		} else if (token == "GL_ARB_multitexture") {
 			multitextureSupported = true;
 		} else if (token == "GL_ARB_framebuffer_object") {
@@ -251,13 +239,6 @@ void Context::initialize(ContextType contextType) {
 		debug(5, "OpenGL: GLES2 context initialized");
 	} else if (type == kContextGLES) {
 		// GLES doesn't support shaders natively
-		// We don't do any aliasing in our code and expect standard OpenGL functions but GLAD does it
-		// So if we use GLAD we can check for ARB extensions and expect a GLSL of 1.00
-#ifdef USE_GLAD
-		shadersSupported = ARBShaderObjects && ARBShadingLanguage100 && ARBVertexShader && ARBFragmentShader;
-		glslVersion = 100;
-#endif
-		// We don't expect GLES to support shaders recent enough for engines
 
 		// ScummVM does not support multisample FBOs with GLES for now
 		framebufferObjectMultisampleSupported = false;
@@ -271,16 +252,6 @@ void Context::initialize(ContextType contextType) {
 	} else if (type == kContextGL) {
 		shadersSupported = glslVersion >= 100;
 
-		// We don't do any aliasing in our code and expect standard OpenGL functions but GLAD does it
-		// So if we use GLAD we can check for ARB extensions and expect a GLSL of 1.00
-#ifdef USE_GLAD
-		if (!shadersSupported) {
-			shadersSupported = ARBShaderObjects && ARBShadingLanguage100 && ARBVertexShader && ARBFragmentShader;
-			if (shadersSupported) {
-				glslVersion = 100;
-			}
-		}
-#endif
 		// In GL mode engines need GLSL 1.20
 		enginesShadersSupported = glslVersion >= 120;
 
diff --git a/graphics/opengl/shader.cpp b/graphics/opengl/shader.cpp
index 99f23e3c14a..5dbac4b6d7f 100644
--- a/graphics/opengl/shader.cpp
+++ b/graphics/opengl/shader.cpp
@@ -155,7 +155,6 @@ GLuint Shader::createCompatShader(const char *shaderSource, GLenum shaderType, c
 	GLchar versionSource[20];
 	if (OpenGLContext.type == kContextGLES2) {
 		switch(compatGLSLVersion) {
-			case 100:
 			case 110:
 			case 120:
 				// GLSL ES 1.00 is a subset of GLSL 1.20
@@ -168,7 +167,6 @@ GLuint Shader::createCompatShader(const char *shaderSource, GLenum shaderType, c
 		}
 	} else {
 		switch(compatGLSLVersion) {
-			case 100:
 			case 110:
 			case 120:
 				break;




More information about the Scummvm-git-logs mailing list