Add internal compute pipeline in ResolveQuerySet for Timestamp Query

- Enable internal compute pipeline in ResolveQuerySet for Timestamp
  Query.
- Known issue:
  The user-provided resolve buffer cannot be used as binding resources
  due to missing STORAGE usage. Currently implictly add STORAGE usage
  if the buffer is created with QUERY_RESOLVE usage as a workaround.
  Next we will add STORAGE_INTERNAL usage instead.

Bug: dawn:434
Change-Id: Ie66090de38bc3a04a58986669cd2a128b528f960
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36222
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
diff --git a/src/dawn_native/Buffer.cpp b/src/dawn_native/Buffer.cpp
index 79ecaba..74d74eb 100644
--- a/src/dawn_native/Buffer.cpp
+++ b/src/dawn_native/Buffer.cpp
@@ -135,6 +135,14 @@
         if (mUsage & wgpu::BufferUsage::Storage) {
             mUsage |= kReadOnlyStorageBuffer;
         }
+
+        // TODO(hao.x.li@intel.com): This is just a workaround to make QueryResolve buffer pass the
+        // binding group validation when used as an internal resource. Instead the buffer made with
+        // QueryResolve usage would implicitly get StorageInternal usage which is only compatible
+        // with StorageBufferInternal binding type in BGL, not StorageBuffer binding type.
+        if (mUsage & wgpu::BufferUsage::QueryResolve) {
+            mUsage |= wgpu::BufferUsage::Storage;
+        }
     }
 
     BufferBase::BufferBase(DeviceBase* device,