Skip to content

Commit

Permalink
Do not error on empty shader, just treat it as invalid by default. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
reduz committed Nov 14, 2018
1 parent 55f5f47 commit 4d88721
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gles2/rasterizer_storage_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions drivers/gles3/rasterizer_storage_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4d88721

Please sign in to comment.