[dawn-test] On D3D12, limit the texels in a buffer to 1<<27

On D3D12, there is a limit of the number of texels in a buffer which is 1<<27. See D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP and the spec. This patch limits it according to the spec in case of D3D12 in MaxLimitTests.cpp. This fixes MaxLimitTests failure on Arm device.

Bug: dawn:884
Change-Id: Ia14ebca92855ec7b7e8d81b7bd547108948da567
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133961
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Min Lee <lemi@microsoft.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
index 95e6e4f..e080ac3 100644
--- a/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
+++ b/src/dawn/native/d3d11/PhysicalDeviceD3D11.cpp
@@ -184,8 +184,9 @@
 
     // Max number of "constants" where each constant is a 16-byte float4
     limits->v1.maxUniformBufferBindingSize = D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * 16;
-    // D3D11 has no documented limit on the size of a storage buffer binding.
-    limits->v1.maxStorageBufferBindingSize = kAssumedMaxBufferSize;
+    // D3D11 limit of number of texels in a buffer == (1 << 27)
+    limits->v1.maxStorageBufferBindingSize = uint64_t(1)
+                                             << D3D11_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP;
     // D3D11 has no documented limit on the buffer size.
     limits->v1.maxBufferSize = kAssumedMaxBufferSize;
 
diff --git a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
index acecd96..0b9c14c 100644
--- a/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
+++ b/src/dawn/native/d3d12/PhysicalDeviceD3D12.cpp
@@ -307,8 +307,9 @@
 
     // Max number of "constants" where each constant is a 16-byte float4
     limits->v1.maxUniformBufferBindingSize = D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * 16;
-    // D3D12 has no documented limit on the size of a storage buffer binding.
-    limits->v1.maxStorageBufferBindingSize = kAssumedMaxBufferSize;
+    // D3D12 limit of number of texels in a buffer == (1 << 27)
+    limits->v1.maxStorageBufferBindingSize = uint64_t(1)
+                                             << D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP;
     // D3D12 has no documented limit on the buffer size.
     limits->v1.maxBufferSize = kAssumedMaxBufferSize;