Add query availability tracking in render pass encoder

The same query cannot be written twice in same render pass, so each
render pass also need to have its own query availability map.

Update timestamp query to only check the same query overwrite in same
render pass.

Bug: dawn:434
Change-Id: Icb070adf79a3d76c25367675f7432666eb0dd84f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31180
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
diff --git a/src/dawn_native/CommandValidation.h b/src/dawn_native/CommandValidation.h
index 3e46774..d2794e2 100644
--- a/src/dawn_native/CommandValidation.h
+++ b/src/dawn_native/CommandValidation.h
@@ -19,7 +19,6 @@
 #include "dawn_native/Error.h"
 #include "dawn_native/Texture.h"
 
-#include <map>
 #include <vector>
 
 namespace dawn_native {
@@ -30,8 +29,6 @@
     struct PassResourceUsage;
     struct TexelBlockInfo;
 
-    using UsedQueryMap = std::map<QuerySetBase*, std::vector<bool>>;
-
     MaybeError ValidateCanPopDebugGroup(uint64_t debugGroupStackSize);
     MaybeError ValidateFinalDebugGroupStackSize(uint64_t debugGroupStackSize);
 
@@ -42,9 +39,7 @@
 
     MaybeError ValidatePassResourceUsage(const PassResourceUsage& usage);
 
-    MaybeError ValidateTimestampQuery(QuerySetBase* querySet,
-                                      uint32_t queryIndex,
-                                      const UsedQueryMap& usedQueryIndices);
+    MaybeError ValidateTimestampQuery(QuerySetBase* querySet, uint32_t queryIndex);
 
     ResultOrError<uint64_t> ComputeRequiredBytesInCopy(const TexelBlockInfo& blockInfo,
                                                        const Extent3D& copySize,