Browse Source

GLES2: Fix VersionKey comparison in `ShaderGLES2::bind()`

This was comparing arrays, GCC 12 raises a warning for it:

```
drivers/gles2/shader_gles2.cpp: In member function 'bool ShaderGLES2::bind()':
drivers/gles2/shader_gles2.cpp:80:71: error: comparison between two arrays [-Werror=array-compare]
   80 |         if (active != this || !version || new_conditional_version.key != conditional_version.key) {
      |                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gles2/shader_gles2.cpp:80:71: note: use unary '+' which decays operands to pointers or '&'component_ref' not supported by dump_decl<declaration error>[0] != &'component_ref' not supported by dump_decl<declaration error>[0]' to compare the addresses
```

(cherry picked from commit 76df26b11062fb3e714ff9e25fde4b5752c20195)
Rémi Verschelde 3 years ago
parent
commit
cb66b672d7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/gles2/shader_gles2.cpp

+ 1 - 1
drivers/gles2/shader_gles2.cpp

@@ -77,7 +77,7 @@ GLint ShaderGLES2::get_uniform_location(int p_index) const {
 }
 }
 
 
 bool ShaderGLES2::bind() {
 bool ShaderGLES2::bind() {
-	if (active != this || !version || new_conditional_version.key != conditional_version.key) {
+	if (active != this || !version || !(new_conditional_version == conditional_version)) {
 		conditional_version = new_conditional_version;
 		conditional_version = new_conditional_version;
 		version = get_current_version();
 		version = get_current_version();
 	} else {
 	} else {