mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Forbids varying declaration in particles and sky shaders
This commit is contained in:
parent
8039978110
commit
53740c69df
1 changed files with 8 additions and 0 deletions
|
|
@ -6099,6 +6099,14 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
|||
case TK_UNIFORM:
|
||||
case TK_VARYING: {
|
||||
bool uniform = tk.type == TK_UNIFORM;
|
||||
|
||||
if (!uniform) {
|
||||
if (shader_type_identifier == "particles" || shader_type_identifier == "sky") {
|
||||
_set_error(vformat("Varyings cannot be used in '%s' shaders!", shader_type_identifier));
|
||||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
DataPrecision precision = PRECISION_DEFAULT;
|
||||
DataInterpolation interpolation = INTERPOLATION_SMOOTH;
|
||||
DataType type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue