mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-24 23:43:30 +00:00
A lot of our switches over enum values use the following pattern: default: UNREACHABLE(); return foo; This is problematic because when adding a new value to one of the WebGPU enums, there is no compilation error for switches that are missing it. Currently we're supposed to write code and tests and fix UNREACHABLEs when we see them. Instead we should strive to have most switches on enums to be complete and explicitily tag unreachable values as UNREACHABLE. Some switches might still want to use default: UNREACHABLE() if only a couple values need to be handled out of very many. In this CL we go through all the UNRAECHABLEs and change them if need be. Also an ErrorQueue class is added to avoid having QueueBase::SubmitImpl just be UNREACHABLE (and force overriding instead). Bug: dawn:527 Change-Id: I33dfb4703104912cc5f001f9faf907a61324de68 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28501 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>