Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
graphite
dawn
DawnErrorChecker.h
Go to the documentation of this file.
1
/*
2
* Copyright 2023 Google LLC
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef skgpu_graphite_DawnErrorChecker_DEFINED
9
#define skgpu_graphite_DawnErrorChecker_DEFINED
10
11
#include "
src/base/SkEnumBitMask.h
"
12
13
#include "
src/gpu/graphite/dawn/DawnAsyncWait.h
"
14
15
#include "webgpu/webgpu_cpp.h"
// NO_G3_REWRITE
16
17
namespace
skgpu::graphite
{
18
19
class
DawnCaps;
20
21
enum class
DawnErrorType
: uint32_t {
22
kNoError
= 0b00000000,
23
kValidation
= 0b00000001,
24
kOutOfMemory
= 0b00000010,
25
kInternal
= 0b00000100,
26
};
27
SK_MAKE_BITMASK_OPS
(
DawnErrorType
);
28
29
// DawnErrorChecker immediately pushes error scopes for all known Dawn error filter types
30
// (Validation, OutOfMemory, Internal) upon construction and detects any errors that are
31
// reported within those scopes. Errors can be detected synchronously by either
32
//
33
// 1. calling `check()`, which returns false if any errors were reported, or
34
// 2. destroying the DawnErrorChecker instance, which asserts if any errors are reported
35
// which weren't previously caught by calling `check()` directly.
36
//
37
class
DawnErrorChecker
{
38
public
:
39
explicit
DawnErrorChecker
(
const
DawnSharedContext
*);
40
~DawnErrorChecker
();
41
42
SkEnumBitMask<DawnErrorType>
popErrorScopes
();
43
44
private
:
45
bool
fArmed =
true
;
46
const
DawnSharedContext
* fSharedContext;
47
};
48
49
}
// namespace skgpu::graphite
50
51
#endif
// skgpu_graphite_DawnErrorChecker_DEFINED
DawnAsyncWait.h
SkEnumBitMask.h
SK_MAKE_BITMASK_OPS
#define SK_MAKE_BITMASK_OPS(E)
Definition
SkEnumBitMask.h:68
SkEnumBitMask
Definition
SkEnumBitMask.h:34
skgpu::graphite::DawnErrorChecker
Definition
DawnErrorChecker.h:37
skgpu::graphite::DawnErrorChecker::~DawnErrorChecker
~DawnErrorChecker()
Definition
DawnErrorChecker.cpp:33
skgpu::graphite::DawnErrorChecker::popErrorScopes
SkEnumBitMask< DawnErrorType > popErrorScopes()
Definition
DawnErrorChecker.cpp:39
skgpu::graphite::DawnSharedContext
Definition
DawnSharedContext.h:22
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
skgpu::graphite::DawnErrorType
DawnErrorType
Definition
DawnErrorChecker.h:21
skgpu::graphite::DawnErrorType::kValidation
@ kValidation
skgpu::graphite::DawnErrorType::kInternal
@ kInternal
skgpu::graphite::DawnErrorType::kOutOfMemory
@ kOutOfMemory
skgpu::graphite::DawnErrorType::kNoError
@ kNoError
Generated on Fri Apr 26 2024 06:17:16 for Flutter Engine by
1.9.8