From 41643e268e318d62ca6e7f9d16c12dc2dbba74c6 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Thu, 13 Feb 2020 21:02:47 +0300 Subject: [PATCH] Prevent usage 'out' modifier on opaque shader types (textures currently) --- servers/visual/shader_language.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 61664893024..76348373c92 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -6273,6 +6273,13 @@ Error ShaderLanguage::_parse_shader(const Map &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 {