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 <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Yunchao He 2021-07-16 20:12:27 +00:00 committed by Dawn LUCI CQ
parent 83241616ae
commit cfbc4225a5
1 changed files with 3 additions and 1 deletions

View File

@ -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) {