Skip to content

Commit

Permalink
GL3+: avoid conflict between OSX shader patching and UnifiedShader
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Dec 12, 2021
1 parent 0fa0a11 commit 396ed67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions RenderSystems/GL3Plus/src/GLSL/src/OgreGLSLShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ namespace Ogre {
if(belowVersionPos != 0)
mSource = mSource.erase(0, belowVersionPos); // drop old definition

if(mSource.find("out vec4") == String::npos && mType == GPT_FRAGMENT_PROGRAM)
mSource.insert(0, "#define gl_FragColor FragColor\nout vec4 FragColor;\n");

// automatically upgrade to glsl150. thank you apple.
const char* prefixFp =
"#version 150\n"
Expand All @@ -374,9 +377,7 @@ namespace Ogre {
"#define texture2DLod textureLod\n"
"#define texture2DProj textureProj\n"
"#define textureCubeLod textureLod\n"
"#define shadow2DProj textureProj\n"
"#define gl_FragColor FragColor\n"
"out vec4 FragColor;\n";
"#define shadow2DProj textureProj\n";
const char* prefixVp =
"#version 150\n"
"#define attribute in\n"
Expand Down

0 comments on commit 396ed67

Please sign in to comment.