|
@@ -61,6 +61,8 @@ String ShaderWarning::get_message() const {
|
|
return vformat("The varying '%s' is declared but never used.", subject);
|
|
return vformat("The varying '%s' is declared but never used.", subject);
|
|
case UNUSED_LOCAL_VARIABLE:
|
|
case UNUSED_LOCAL_VARIABLE:
|
|
return vformat("The local variable '%s' is declared but never used.", subject);
|
|
return vformat("The local variable '%s' is declared but never used.", subject);
|
|
|
|
+ case FORMATTING_ERROR:
|
|
|
|
+ return subject;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -82,6 +84,7 @@ String ShaderWarning::get_name_from_code(Code p_code) {
|
|
"UNUSED_UNIFORM",
|
|
"UNUSED_UNIFORM",
|
|
"UNUSED_VARYING",
|
|
"UNUSED_VARYING",
|
|
"UNUSED_LOCAL_VARIABLE",
|
|
"UNUSED_LOCAL_VARIABLE",
|
|
|
|
+ "FORMATTING_ERROR",
|
|
};
|
|
};
|
|
|
|
|
|
static_assert((sizeof(names) / sizeof(*names)) == WARNING_MAX, "Amount of warning types don't match the amount of warning names.");
|
|
static_assert((sizeof(names) / sizeof(*names)) == WARNING_MAX, "Amount of warning types don't match the amount of warning names.");
|
|
@@ -110,6 +113,7 @@ static void init_code_to_flags_map() {
|
|
code_to_flags_map->insert(ShaderWarning::UNUSED_UNIFORM, ShaderWarning::UNUSED_UNIFORM_FLAG);
|
|
code_to_flags_map->insert(ShaderWarning::UNUSED_UNIFORM, ShaderWarning::UNUSED_UNIFORM_FLAG);
|
|
code_to_flags_map->insert(ShaderWarning::UNUSED_VARYING, ShaderWarning::UNUSED_VARYING_FLAG);
|
|
code_to_flags_map->insert(ShaderWarning::UNUSED_VARYING, ShaderWarning::UNUSED_VARYING_FLAG);
|
|
code_to_flags_map->insert(ShaderWarning::UNUSED_LOCAL_VARIABLE, ShaderWarning::UNUSED_LOCAL_VARIABLE_FLAG);
|
|
code_to_flags_map->insert(ShaderWarning::UNUSED_LOCAL_VARIABLE, ShaderWarning::UNUSED_LOCAL_VARIABLE_FLAG);
|
|
|
|
+ code_to_flags_map->insert(ShaderWarning::FORMATTING_ERROR, ShaderWarning::FORMATTING_ERROR_FLAG);
|
|
}
|
|
}
|
|
|
|
|
|
ShaderWarning::CodeFlags ShaderWarning::get_flags_from_codemap(const Map<Code, bool> &p_map) {
|
|
ShaderWarning::CodeFlags ShaderWarning::get_flags_from_codemap(const Map<Code, bool> &p_map) {
|