Fix internal storage buffer usage TimestampQueryTests.ResolveTwiceToSameBuffer fails on Intel latest driver on Windows, because the kInternalStorageBuffer is not treated in buffer usage when adding resource barrier. Add missed kInternalStorageBuffer in buffer usage and remove D3D12_RESOURCE_STATE_UNORDERED_ACCESS from QueryResolve, which will be added by kInternalStorageBuffer. Bug: dawn:797 Change-Id: I78607002179ba443b0db09c9c3bbc85fcc97a85b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56523 Reviewed-by: Corentin Wallez <cwallez@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 56c6ea6..7bb1633 100644 --- a/src/dawn_native/Buffer.cpp +++ b/src/dawn_native/Buffer.cpp
@@ -138,9 +138,12 @@ mUsage |= kReadOnlyStorageBuffer; } - // The buffer made with QueryResolve usage implicitly get InternalStorage usage which is - // only compatible with InternalStorageBuffer binding type in BGL, not StorageBuffer binding - // type. + // The query resolve buffer need to be used as a storage buffer in the internal compute + // pipeline which does timestamp uint conversion for timestamp query, it requires the buffer + // has Storage usage in the binding group. Implicitly add an InternalStorage usage which is + // only compatible with InternalStorageBuffer binding type in BGL. It shouldn't be + // compatible with StorageBuffer binding type and the query resolve buffer cannot be bound + // as storage buffer if it's created without Storage usage. if (mUsage & wgpu::BufferUsage::QueryResolve) { mUsage |= kInternalStorageBuffer; }