Browse Source

#pragma language glsl4 in shaders maps to GLES 3.2 instead of 3.1.

Alex Szpakowski 3 years ago
parent
commit
91cb845f31

+ 1 - 6
src/modules/graphics/Shader.cpp

@@ -78,11 +78,6 @@ static const char global_syntax[] = R"(
 #ifdef GL_OES_standard_derivatives
 #extension GL_OES_standard_derivatives : enable
 #endif
-#if __VERSION__ >= 300 && defined(GL_OES_texture_buffer)
-#extension GL_OES_texture_buffer : enable
-#elif __VERSION__ >= 300 && defined(GL_EXT_texture_buffer)
-#extension GL_EXT_texture_buffer : enable
-#endif
 )";
 
 static const char render_uniforms[] = R"(
@@ -449,7 +444,7 @@ static const Version versions[] =
 {
 	{ "#version 120", "#version 100" },
 	{ "#version 330 core", "#version 300 es" },
-	{ "#version 430 core", "#version 310 es" },
+	{ "#version 430 core", "#version 320 es" },
 };
 
 static Shader::Language getTargetLanguage(const std::string &src)

+ 1 - 6
src/modules/graphics/opengl/Buffer.cpp

@@ -153,12 +153,7 @@ bool Buffer::load(const void *initialdata)
 
 		GLenum glformat = getGLFormat(getDataMember(0).decl.format);
 
-		if (GLAD_VERSION_3_1)
-			glTexBuffer(target, glformat, buffer);
-		else if (GLAD_OES_texture_buffer)
-			glTexBufferOES(target, glformat, buffer);
-		else if (GLAD_EXT_texture_buffer)
-			glTexBufferEXT(target, glformat, buffer);
+		glTexBuffer(target, glformat, buffer);
 	}
 
 	return (glGetError() == GL_NO_ERROR);

+ 1 - 2
src/modules/graphics/opengl/OpenGL.cpp

@@ -1479,8 +1479,7 @@ bool OpenGL::isBufferUsageSupported(BufferUsage usage) const
 	case BUFFERUSAGE_INDEX:
 		return true;
 	case BUFFERUSAGE_TEXEL:
-		// Not supported in ES until 3.2, so we rely on extensions there...
-		return GLAD_VERSION_3_1 || GLAD_OES_texture_buffer || GLAD_EXT_texture_buffer;
+		return GLAD_VERSION_3_1 || GLAD_ES_VERSION_3_2;
 	case BUFFERUSAGE_SHADER_STORAGE:
 		return (GLAD_VERSION_4_3 && isCoreProfile()) || GLAD_ES_VERSION_3_1;
 	case BUFFERUSAGE_MAX_ENUM:

+ 1 - 1
src/modules/window/sdl/Window.cpp

@@ -262,7 +262,7 @@ std::vector<Window::ContextAttribs> Window::getContextAttribsList() const
 
 	std::vector<ContextAttribs> glescontexts =
 	{
-		{3, 1, true, debug},
+		{3, 2, true, debug},
 		{3, 0, true, debug},
 		{2, 0, true, debug}
 	};