summaryrefslogtreecommitdiff
path: root/drivers/gles2/shader_gles2.cpp
diff options
context:
space:
mode:
authorMarcin Zawiejski <dragmz@gmail.com>2018-08-20 02:10:14 +0200
committerMarcin Zawiejski <dragmz@gmail.com>2018-08-20 02:10:14 +0200
commitbd5ff205b2c1f6ebeeab94bb8dc02a2ff725f628 (patch)
tree44782f77c728e95027100cf64fe041e398a562de /drivers/gles2/shader_gles2.cpp
parentfaa49c182978b3fe74e7aad65fb761c2881f009c (diff)
Revert "Batch GLES2 draw calls"
This reverts commit f55039b194bbbd8d797b667d67e5677fb429d356. The GLES2 batching seems to require more testing and tweaking in order to actually make the performance better on Android devices. It's been proved with #21184 that the current implementation has it's drawbacks therefore I suggest reverting the commit for now.
Diffstat (limited to 'drivers/gles2/shader_gles2.cpp')
-rw-r--r--drivers/gles2/shader_gles2.cpp14
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;
-}