Fix D3D12 render-pass failure when GPU does not support sampling positions.

It is invalid to specify a resolve source region on GPUs that do not
support sample positions. Instead, the entire region rect should be
set to all zeros or "empty" to always resolve the entire region.

Bug: dawn:36
Change-Id: I23575b2186bffbcb2e236988558b78f97375a126
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/13501
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
diff --git a/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp b/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp
index e535a66..c6846a0 100644
--- a/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp
+++ b/src/dawn_native/d3d12/RenderPassBuilderD3D12.cpp
@@ -92,8 +92,11 @@
             subresourceParameters.SrcSubresource = 0;
             subresourceParameters.DstSubresource = resolveDestinationTexture->GetSubresourceIndex(
                 resolveDestination->GetBaseMipLevel(), resolveDestination->GetBaseArrayLayer());
-            subresourceParameters.SrcRect = {0, 0, resolveDestinationTexture->GetSize().width,
-                                             resolveDestinationTexture->GetSize().height};
+            // Resolving a specified sub-rect is only valid on hardware that supports sample
+            // positions. This means even {0, 0, width, height} would be invalid if unsupported. To
+            // avoid this, we assume sub-rect resolves never work by setting them to all zeros or
+            // "empty" to resolve the entire region.
+            subresourceParameters.SrcRect = {0, 0, 0, 0};
 
             return subresourceParameters;
         }