diff options
Diffstat (limited to 'drivers/gles2/shader_gles2.cpp')
-rw-r--r-- | drivers/gles2/shader_gles2.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp index 89c1b6490d..e9b58cb272 100644 --- a/drivers/gles2/shader_gles2.cpp +++ b/drivers/gles2/shader_gles2.cpp @@ -122,11 +122,13 @@ GLint ShaderGLES2::get_uniform_location(int p_index) const { } bool ShaderGLES2::bind() { - if (!is_dirty()) - return false; - conditional_version = new_conditional_version; - version = get_current_version(); + if (active != this || !version || new_conditional_version.key != conditional_version.key) { + conditional_version = new_conditional_version; + version = get_current_version(); + } else { + return false; + } ERR_FAIL_COND_V(!version, false); @@ -1107,7 +1109,3 @@ ShaderGLES2::ShaderGLES2() { ShaderGLES2::~ShaderGLES2() { finish(); } - -bool ShaderGLES2::is_dirty() const { - return active != this || !version || new_conditional_version.key != conditional_version.key; -} |