Просмотр исходного кода

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
```
Rémi Verschelde 3 лет назад
Родитель
Сommit
76df26b110
1 измененных файлов с 1 добавлено и 1 удалено
  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() {
-	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;
 		version = get_current_version();
 	} else {