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