fuzzing: Add error injection macros to the Vulkan backend

This will enable fuzzing the Vulkan backend with randomly injected
errors to help ensure the backend properly handles all errors. It also
redefines VkResult in the dawn_native::vulkan namespace such that a
VkResult cannot be used unless it is explicitly wrapped.

Bug: dawn:295
Change-Id: I3ab2f98702a67a61afe06315658a9ab76ed4ccc3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14520
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni
index ab1d595..7cbb82f 100644
--- a/scripts/dawn_features.gni
+++ b/scripts/dawn_features.gni
@@ -12,6 +12,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import("//build_overrides/build.gni")
+
+if (build_with_chromium) {
+  import("//build/config/sanitizers/sanitizers.gni")
+}
+
 declare_args() {
   # Enable Dawn's ASSERTs even in release builds
   dawn_always_assert = false
@@ -51,6 +57,10 @@
   # Because of how the Vulkan loader works, setting this make Dawn only able
   # to find the Swiftshader ICD and not the others.
   dawn_use_swiftshader = false
+
+  # Enables error injection for faking failures to native API calls
+  dawn_enable_error_injection =
+      is_debug || (build_with_chromium && use_fuzzing_engine)
 }
 
 # GN does not allow reading a variable defined in the same declare_args().