Fixes validation,error_scope:simple:errorType="out-of-memory";* tests

The test was failing because creating the max 2d texture wasn't actually
causing an OOM because the device limits are clamped downwards. By
exposing an additional tier, the larger image now causes the OOM
reliably.

- Adds an additional tier for 1d/2d texture dimensions.
- Makes sure that OOM error is surfaced instead of internal error in
  Vulkan's CreateImage.

Bug: dawn:1960
Change-Id: Iaabfbf8f319697d0dcab1b8e8d8c3dc1046babcf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/159662
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/native/Limits.cpp b/src/dawn/native/Limits.cpp
index 5b55df4..d6135fb 100644
--- a/src/dawn/native/Limits.cpp
+++ b/src/dawn/native/Limits.cpp
@@ -96,15 +96,21 @@
     X(Maximum,               maxInterStageShaderComponents,       60,        60,        112) \
     X(Maximum,               maxInterStageShaderVariables,        16,        16,         28) \
 
+// Tiered limits for texture dimensions.
+// TODO(crbug.com/dawn/685): Define these better. For now, use two tiers where some dimensions
+// offers slightly better than default limits.
+//                                                             compat      tier0       tier1
+#define LIMITS_TEXTURE_DIMENSIONS(X) \
+    X(Maximum,                       maxTextureDimension1D,      4096,      8192,      16384) \
+    X(Maximum,                       maxTextureDimension2D,      4096,      8192,      16384) \
+    X(Maximum,                       maxTextureDimension3D,      1024,      2048,       2048) \
+    X(Maximum,                       maxTextureArrayLayers,       256,       256,        256)
+
 // TODO(crbug.com/dawn/685):
 // These limits don't have tiers yet. Define two tiers with the same values since the macros
 // in this file expect more than one tier.
 //                                                             compat      tier0       tier1
 #define LIMITS_OTHER(X)                                                                       \
-    X(Maximum,                       maxTextureDimension1D,      4096,      8192,       8192) \
-    X(Maximum,                       maxTextureDimension2D,      4096,      8192,       8192) \
-    X(Maximum,                       maxTextureDimension3D,      1024,      2048,       2048) \
-    X(Maximum,                       maxTextureArrayLayers,       256,       256,        256) \
     X(Maximum,                               maxBindGroups,         4,         4,          4) \
     X(Maximum,              maxBindGroupsPlusVertexBuffers,        24,        24,         24) \
     X(Maximum,                     maxBindingsPerBindGroup,      1000,      1000,       1000) \
@@ -138,6 +144,7 @@
     LIMITS_STORAGE_BUFFER_BINDINGS(X)      \
     LIMITS_ATTACHMENTS(X)                  \
     LIMITS_INTER_STAGE_SHADER_VARIABLES(X) \
+    LIMITS_TEXTURE_DIMENSIONS(X)           \
     LIMITS_OTHER(X)
 
 namespace dawn::native {
diff --git a/src/dawn/native/vulkan/TextureVk.cpp b/src/dawn/native/vulkan/TextureVk.cpp
index 1f78152..6d65e13 100644
--- a/src/dawn/native/vulkan/TextureVk.cpp
+++ b/src/dawn/native/vulkan/TextureVk.cpp
@@ -860,7 +860,7 @@
     // also required for the implementation of robust resource initialization.
     createInfo.usage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT;
 
-    DAWN_TRY(CheckVkSuccess(
+    DAWN_TRY(CheckVkOOMThenSuccess(
         device->fn.CreateImage(device->GetVkDevice(), &createInfo, nullptr, &*mHandle),
         "CreateImage"));
     mOwnsHandle = true;