From 4d88721e625b300608f54b14e7dd150411e5497b Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 14 Nov 2018 10:57:43 -0300 Subject: [PATCH] Do not error on empty shader, just treat it as invalid by default. Fixes #15998. --- drivers/gles2/rasterizer_storage_gles2.cpp | 4 ++++ drivers/gles3/rasterizer_storage_gles3.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 18015f61d42..060988fbeae 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1125,6 +1125,10 @@ void RasterizerStorageGLES2::_update_shader(Shader *p_shader) const { p_shader->uniforms.clear(); + if (p_shader->code == String()) { + return; //just invalid, but no error + } + ShaderCompilerGLES2::GeneratedCode gen_code; ShaderCompilerGLES2::IdentifierActions *actions = NULL; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 14084675af6..7ca7d8a471e 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -1903,6 +1903,10 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const { p_shader->uniforms.clear(); + if (p_shader->code == String()) { + return; //just invalid, but no error + } + ShaderCompilerGLES3::GeneratedCode gen_code; ShaderCompilerGLES3::IdentifierActions *actions = NULL;