Visual Shaders are back.

This commit is contained in:
Juan Linietsky 2018-07-14 18:15:42 -03:00
parent 1fc7973a00
commit f6ce73f724
32 changed files with 6368 additions and 93 deletions

View file

@ -3583,7 +3583,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
return OK;
}
Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types) {
Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_functions, const Vector<StringName> &p_render_modes, const Set<String> &p_shader_types) {
Token tk = _get_token();
@ -3642,7 +3642,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
return ERR_PARSE_ERROR;
}
if (!p_render_modes.has(mode)) {
if (p_render_modes.find(mode) == -1) {
_set_error("Invalid render mode: '" + String(mode) + "'");
return ERR_PARSE_ERROR;
}
@ -4097,7 +4097,7 @@ String ShaderLanguage::get_shader_type(const String &p_code) {
return String();
}
Error ShaderLanguage::compile(const String &p_code, const Map<StringName, FunctionInfo> &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types) {
Error ShaderLanguage::compile(const String &p_code, const Map<StringName, FunctionInfo> &p_functions, const Vector<StringName> &p_render_modes, const Set<String> &p_shader_types) {
clear();
@ -4114,7 +4114,7 @@ Error ShaderLanguage::compile(const String &p_code, const Map<StringName, Functi
return OK;
}
Error ShaderLanguage::complete(const String &p_code, const Map<StringName, FunctionInfo> &p_functions, const Set<String> &p_render_modes, const Set<String> &p_shader_types, List<String> *r_options, String &r_call_hint) {
Error ShaderLanguage::complete(const String &p_code, const Map<StringName, FunctionInfo> &p_functions, const Vector<StringName> &p_render_modes, const Set<String> &p_shader_types, List<String> *r_options, String &r_call_hint) {
clear();
@ -4134,9 +4134,9 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
return ERR_PARSE_ERROR;
} break;
case COMPLETION_RENDER_MODE: {
for (const Set<String>::Element *E = p_render_modes.front(); E; E = E->next()) {
for (int i = 0; i < p_render_modes.size(); i++) {
r_options->push_back(E->get());
r_options->push_back(p_render_modes[i]);
}
return OK;