~ Fixed an infinite loop in the shader compiler

+ Added more valid variable types to the shader compiler so compilation doesn't fail

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez 2021-11-29 13:36:15 +01:00
parent cbb02873a8
commit 9d2e9b43ee
2 changed files with 12 additions and 2 deletions

View File

@ -97,7 +97,7 @@ int main (int argc, char* argv[])
case 'p': case 'p':
case 'd': case 'd':
std::cout << "--dir/--pkg is deprecated and not used anymore" << std::endl; std::cerr << "--dir/--pkg is deprecated and not used anymore" << std::endl;
path = stringPathFixes (optarg); path = stringPathFixes (optarg);
break; break;

View File

@ -302,6 +302,13 @@ namespace WallpaperEngine::Render::Shaders
this->m_compiledContent += "uniform " + type + " " + name + array + ";"; this->m_compiledContent += "uniform " + type + " " + name + array + ";";
} }
} }
else
{
// continue reading the original shader as this most likely is a variable name or something
// that is not really interesting for the compiler
this->m_compiledContent += *it;
it ++;
}
} }
/*else if (*it == 'a') /*else if (*it == 'a')
{ {
@ -661,6 +668,9 @@ namespace WallpaperEngine::Render::Shaders
std::vector<std::string> Compiler::sTypes = std::vector<std::string> Compiler::sTypes =
{ {
"vec4", "vec3", "vec2", "float", "sampler2D", "mat4x3", "mat4", "uint4" "vec4", "uvec4", "ivec4", "dvec4", "bvec4",
"vec3", "uvec3", "ivec3", "dvec3", "bvec3",
"vec2", "uvec2", "ivec2", "dvec2", "bvec2",
"float", "sampler2D", "mat4x3", "mat4", "mat3", "uint4"
}; };
} }