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>
This commit is contained in:
Austin Eng
2019-12-17 00:47:40 +00:00
committed by Commit Bot service account
parent 2c8a17ecc7
commit 6ea362cae0
15 changed files with 437 additions and 104 deletions

View File

@@ -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 @@ declare_args() {
# 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().