This commit is contained in:
Spartan322
2025-02-21 23:27:43 -05:00
283 changed files with 80699 additions and 11854 deletions

View File

@@ -688,30 +688,14 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene
vcode += _prestr(varying.precision, ShaderLanguage::is_float_type(varying.type));
vcode += _typestr(varying.type);
vcode += " " + _mkid(varying_name);
uint32_t inc = 1U;
uint32_t inc = varying.get_size();
if (varying.array_size > 0) {
inc = (uint32_t)varying.array_size;
vcode += "[";
vcode += itos(varying.array_size);
vcode += "]";
}
switch (varying.type) {
case SL::TYPE_MAT2:
inc *= 2U;
break;
case SL::TYPE_MAT3:
inc *= 3U;
break;
case SL::TYPE_MAT4:
inc *= 4U;
break;
default:
break;
}
vcode += ";\n";
// GLSL ES 3.0 does not allow layout qualifiers for varyings
if (!RS::get_singleton()->is_low_end()) {
@@ -1483,6 +1467,7 @@ Error ShaderCompiler::compile(RS::ShaderMode p_mode, const String &p_code, Ident
info.render_modes = ShaderTypes::get_singleton()->get_modes(p_mode);
info.shader_types = ShaderTypes::get_singleton()->get_types();
info.global_shader_uniform_type_func = _get_global_shader_uniform_type;
info.base_varying_index = actions.base_varying_index;
Error err = parser.compile(p_code, info);