Fix T95278: Crash on startup because of GLSL compiler bug
The GLSL defines used to make the uniform names unusable for local variable is being interpreted as recursive on some implementation. This avoids it by create a second macro avoiding the recursion.
This commit is contained in:
@@ -416,7 +416,9 @@ std::string GLShader::resources_declare(const ShaderCreateInfo &info) const
|
||||
ss << ";\n";
|
||||
}
|
||||
for (const ShaderCreateInfo::PushConst &uniform : info.push_constants_) {
|
||||
ss << "#define " << uniform.name << " (" << uniform.name << ")\n";
|
||||
/* T95278: Double macro to avoid some compilers think it is recusive. */
|
||||
ss << "#define " << uniform.name << "_ " << uniform.name << "\n";
|
||||
ss << "#define " << uniform.name << " (" << uniform.name << _ ")\n";
|
||||
}
|
||||
ss << "\n";
|
||||
return ss.str();
|
||||
|
||||
Reference in New Issue
Block a user