Add sampler2DComparison and uint to known types

This commit is contained in:
Moeta Yuko 2024-09-01 22:05:59 +08:00
parent d4687f09ec
commit 75b354136e

View File

@ -694,7 +694,7 @@ void Compiler::parseParameterConfiguration (const std::string& type, const std::
value = *constant->second->as<CShaderConstantInteger> ()->getValue ();
parameter = new Variables::CShaderVariableInteger (value);
} else if (type == "sampler2D") {
} else if (type == "sampler2D" || type == "sampler2DComparison") {
// samplers can have special requirements, check what sampler we're working with and create definitions
// if needed
const auto textureName = data.find ("default");
@ -755,7 +755,8 @@ const std::map<int, std::string>& Compiler::getTextures () const {
return this->m_textures;
}
std::vector<std::string> Compiler::sTypes = {
"vec4", "uvec4", "ivec4", "dvec4", "bvec4", "vec3", "uvec3", "ivec3", "dvec3", "bvec3", "vec2",
"uvec2", "ivec2", "dvec2", "bvec2", "float", "sampler2D", "mat4x3", "mat4", "mat3", "uint4", "void"};
std::vector<std::string> Compiler::sTypes = {"vec4", "uvec4", "ivec4", "dvec4", "bvec4", "vec3",
"uvec3", "ivec3", "dvec3", "bvec3", "vec2", "uvec2",
"ivec2", "dvec2", "bvec2", "float", "sampler2D", "sampler2DComparison",
"mat4x3", "mat4", "mat3", "uint", "uint4", "void"};
} // namespace WallpaperEngine::Render::Shaders