Skip to content
Snippets Groups Projects
Commit ea6f6e83 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix FXAA init failure in GL 3.1

parent fe56d468
No related branches found
No related tags found
No related merge requests found
...@@ -557,17 +557,11 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev ...@@ -557,17 +557,11 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
} }
else if (major_version == 3) else if (major_version == 3)
{ {
if (minor_version < 10) if (minor_version <= 29)
{ {
shader_code_text[shader_code_count++] = strdup("#version 300\n"); // OpenGL 3.2 had GLSL version 1.50. anything after that the version numbers match.
} // https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#OpenGL_and_GLSL_versions
else if (minor_version <= 19) shader_code_text[shader_code_count++] = strdup("#version 150\n");
{
shader_code_text[shader_code_count++] = strdup("#version 310\n");
}
else if (minor_version <= 29)
{
shader_code_text[shader_code_count++] = strdup("#version 320\n");
} }
else else
{ {
...@@ -576,7 +570,8 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev ...@@ -576,7 +570,8 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
} }
else else
{ {
if (type == GL_GEOMETRY_SHADER) // OpenGL 3.2 had GLSL version 1.50. anything after that the version numbers match.
if (type == GL_GEOMETRY_SHADER || minor_version >= 50)
{ {
//set version to 1.50 //set version to 1.50
shader_code_text[shader_code_count++] = strdup("#version 150\n"); shader_code_text[shader_code_count++] = strdup("#version 150\n");
......
...@@ -350,12 +350,12 @@ A. Or use FXAA_GREEN_AS_LUMA. ...@@ -350,12 +350,12 @@ A. Or use FXAA_GREEN_AS_LUMA.
#define FXAA_GATHER4_ALPHA 1 #define FXAA_GATHER4_ALPHA 1
#endif #endif
#ifndef FXAA_GATHER4_ALPHA #ifndef FXAA_GATHER4_ALPHA
#ifdef GL_ARB_gpu_shader5 // #ifdef GL_ARB_gpu_shader5
#define FXAA_GATHER4_ALPHA 1 // #define FXAA_GATHER4_ALPHA 1
#endif // #endif
#ifdef GL_NV_gpu_shader5 // #ifdef GL_NV_gpu_shader5
#define FXAA_GATHER4_ALPHA 1 // #define FXAA_GATHER4_ALPHA 1
#endif // #endif
#ifndef FXAA_GATHER4_ALPHA #ifndef FXAA_GATHER4_ALPHA
#define FXAA_GATHER4_ALPHA 0 #define FXAA_GATHER4_ALPHA 0
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment