summaryrefslogtreecommitdiff
path: root/servers/rendering/shader_compiler.cpp
diff options
context:
space:
mode:
authorYuri Rubinsky <chaosus89@gmail.com>2022-12-22 23:19:30 +0300
committerYuri Rubinsky <chaosus89@gmail.com>2022-12-23 07:47:49 +0300
commitf28348fc5c16cbcc6f1304b29c3f7e0a379391a3 (patch)
treeb0cbf1f685239ce281b578515d50a31f7c9692fe /servers/rendering/shader_compiler.cpp
parentc547c4ef5908b9d591497e40217200ecb12e0ebd (diff)
Fix shader crash when using boolean type for vertex->fragment varyings
Diffstat (limited to 'servers/rendering/shader_compiler.cpp')
-rw-r--r--servers/rendering/shader_compiler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp
index 3604756fd8..00b6a8c44c 100644
--- a/servers/rendering/shader_compiler.cpp
+++ b/servers/rendering/shader_compiler.cpp
@@ -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);