Expand error message if validating maxColorAttachmentBytesPerSample

This CLs expands error message when validating color attachment bytes
per sample to indicate when limits are hit that were not provided in the
device requiredLimits.

Bug: 42240683
Change-Id: Ic7bb267c910a0b488b4bef857fc79988d724c5d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/217595
Commit-Queue: Fr <beaufort.francois@gmail.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/src/dawn/native/CommandValidation.cpp b/src/dawn/native/CommandValidation.cpp
index cb5c66d..0843946 100644
--- a/src/dawn/native/CommandValidation.cpp
+++ b/src/dawn/native/CommandValidation.cpp
@@ -707,10 +707,14 @@
     }
     uint32_t maxColorAttachmentBytesPerSample =
         device->GetLimits().v1.maxColorAttachmentBytesPerSample;
-    DAWN_INVALID_IF(
-        totalByteSize > maxColorAttachmentBytesPerSample,
-        "Total color attachment bytes per sample (%u) exceeds maximum (%u) with formats (%s).",
-        totalByteSize, maxColorAttachmentBytesPerSample, TextureFormatsToString(formats));
+    if (DAWN_UNLIKELY(totalByteSize > maxColorAttachmentBytesPerSample)) {
+        return DAWN_VALIDATION_ERROR(
+            "Total color attachment bytes per sample (%u) exceeds maximum (%u) with formats "
+            "(%s).%s",
+            totalByteSize, maxColorAttachmentBytesPerSample, TextureFormatsToString(formats),
+            DAWN_INCREASE_LIMIT_MESSAGE(device->GetAdapter(), maxColorAttachmentBytesPerSample,
+                                        totalByteSize));
+    }
 
     return {};
 }