mesa: don't reset SamplersValidated if nothing changed

This could prevent error detection, if a uniform change sets
SamplersValidated to true without calling _mesa_update_shader_textures_used.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13416>
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index b2a79f0..858b08c 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1355,6 +1355,7 @@
        */
       bool flushed = false;
       bool any_changed = false;
+      bool samplers_validated = shProg->SamplersValidated;
 
       shProg->SamplersValidated = GL_TRUE;
 
@@ -1409,6 +1410,8 @@
 
       if (any_changed)
          _mesa_update_valid_to_render_state(ctx);
+      else
+         shProg->SamplersValidated = samplers_validated;
    }
 
    /* If the uniform is an image, update the mapping from image