diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2020-02-13 21:02:47 +0300 |
---|---|---|
committer | Yuri Roubinsky <chaosus89@gmail.com> | 2020-02-13 21:02:47 +0300 |
commit | 41643e268e318d62ca6e7f9d16c12dc2dbba74c6 (patch) | |
tree | 6c93f0b0530e207b48a569e2025760dc92bb8d79 /servers/visual | |
parent | 5c3944e7da9ca72077cb5348fadc86347904838c (diff) |
Prevent usage 'out' modifier on opaque shader types (textures currently)
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/shader_language.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 6166489302..76348373c9 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -6273,6 +6273,13 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct return ERR_PARSE_ERROR; } + if (qualifier == ARGUMENT_QUALIFIER_OUT || qualifier == ARGUMENT_QUALIFIER_INOUT) { + if (is_sampler_type(get_token_datatype(tk.type))) { + _set_error("Opaque types cannot be output parameters."); + return ERR_PARSE_ERROR; + } + } + if (is_struct) { ptype = TYPE_STRUCT; } else { |