From 76df26b11062fb3e714ff9e25fde4b5752c20195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 7 Mar 2022 09:30:18 +0100 Subject: [PATCH] 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[0] != &'component_ref' not supported by dump_decl[0]' to compare the addresses ``` --- drivers/gles2/shader_gles2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp index 31288656dc3..1f7393bf107 100644 --- a/drivers/gles2/shader_gles2.cpp +++ b/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 {