1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #63847 from Zylann/shader_switch_uint

This commit is contained in:
Yuri Rubinsky
2022-08-03 08:05:19 +03:00
committed by GitHub

View File

@@ -7158,9 +7158,12 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun
if (!n) {
return ERR_PARSE_ERROR;
}
if (n->get_datatype() != TYPE_INT) {
_set_error(RTR("Expected an integer expression."));
return ERR_PARSE_ERROR;
{
const ShaderLanguage::DataType switch_type = n->get_datatype();
if (switch_type != TYPE_INT && switch_type != TYPE_UINT) {
_set_error(RTR("Expected an integer expression."));
return ERR_PARSE_ERROR;
}
}
tk = _get_token();
if (tk.type != TK_PARENTHESIS_CLOSE) {