mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 16:16:08 +00:00
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:
committed by
Commit Bot service account
parent
2c8a17ecc7
commit
6ea362cae0
@@ -67,6 +67,10 @@ config("dawn_internal") {
|
||||
defines += [ "DAWN_USE_X11" ]
|
||||
}
|
||||
|
||||
if (dawn_enable_error_injection) {
|
||||
defines += [ "DAWN_ENABLE_ERROR_INJECTION" ]
|
||||
}
|
||||
|
||||
# Only internal Dawn targets can use this config, this means only targets in
|
||||
# this BUILD.gn file.
|
||||
visibility = [ ":*" ]
|
||||
|
||||
@@ -78,18 +78,18 @@ class alignas(kNativeVkHandleAlignment) VkNonDispatchableHandle {
|
||||
VkNonDispatchableHandle& operator=(const VkNonDispatchableHandle<Tag, HandleType>&) = default;
|
||||
|
||||
// Comparisons between handles
|
||||
bool operator==(VkNonDispatchableHandle<Tag, HandleType> other) {
|
||||
bool operator==(VkNonDispatchableHandle<Tag, HandleType> other) const {
|
||||
return mHandle == other.mHandle;
|
||||
}
|
||||
bool operator!=(VkNonDispatchableHandle<Tag, HandleType> other) {
|
||||
bool operator!=(VkNonDispatchableHandle<Tag, HandleType> other) const {
|
||||
return mHandle != other.mHandle;
|
||||
}
|
||||
|
||||
// Comparisons between handles and VK_NULL_HANDLE
|
||||
bool operator==(std::nullptr_t) {
|
||||
bool operator==(std::nullptr_t) const {
|
||||
return mHandle == 0;
|
||||
}
|
||||
bool operator!=(std::nullptr_t) {
|
||||
bool operator!=(std::nullptr_t) const {
|
||||
return mHandle != 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user