mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix shader crash when using boolean type for vertex->fragment varyings
This commit is contained in:
parent
c547c4ef59
commit
f28348fc5c
3 changed files with 40 additions and 2 deletions
|
@ -134,6 +134,8 @@ static String _interpstr(SL::DataInterpolation p_interp) {
|
|||
return "flat ";
|
||||
case SL::INTERPOLATION_SMOOTH:
|
||||
return "";
|
||||
case SL::INTERPOLATION_DEFAULT:
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -667,6 +669,9 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene
|
|||
fragment_varyings.insert(varying_name);
|
||||
continue;
|
||||
}
|
||||
if (varying.type < SL::TYPE_INT) {
|
||||
continue; // Ignore boolean types to prevent crashing (if varying is just declared).
|
||||
}
|
||||
|
||||
String vcode;
|
||||
String interp_mode = _interpstr(varying.interpolation);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue