From cfbc4225a50be12b03627aabcac8d3580a527350 Mon Sep 17 00:00:00 2001 From: Yunchao He Date: Fri, 16 Jul 2021 20:12:27 +0000 Subject: [PATCH] Texture::GetTextureViewDescriptorWithDefaults: fix incorrect UNREACHABLE() Bug: chromium:1230062 Change-Id: I3ff2638724d09079106ed048464d2640e206512e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58500 Commit-Queue: Yunchao He Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng --- src/dawn_native/Texture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dawn_native/Texture.cpp b/src/dawn_native/Texture.cpp index 8d6bc55398..ebbabb7197 100644 --- a/src/dawn_native/Texture.cpp +++ b/src/dawn_native/Texture.cpp @@ -390,7 +390,9 @@ namespace dawn_native { desc.arrayLayerCount = texture->GetArrayLayers() - desc.baseArrayLayer; break; default: - UNREACHABLE(); + // We don't put UNREACHABLE() here because we validate enums only after this + // function sets default values. Otherwise, the UNREACHABLE() will be hit. + break; } } if (desc.mipLevelCount == 0) {