Merge pull request #42215 from Chaosus/forbid_invalid_varyings
Forbids varying declaration in particles and sky shaders
This commit is contained in:
commit
466a6d75e4
|
@ -6099,6 +6099,14 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||||
case TK_UNIFORM:
|
case TK_UNIFORM:
|
||||||
case TK_VARYING: {
|
case TK_VARYING: {
|
||||||
bool uniform = tk.type == TK_UNIFORM;
|
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;
|
DataPrecision precision = PRECISION_DEFAULT;
|
||||||
DataInterpolation interpolation = INTERPOLATION_SMOOTH;
|
DataInterpolation interpolation = INTERPOLATION_SMOOTH;
|
||||||
DataType type;
|
DataType type;
|
||||||
|
|
Loading…
Reference in New Issue