Auto merge of #27447 - kunalmohan:gpu-error, r=kvark

Refactor and improve GPUErrorScopes

- Remove use of equivalent BGLs
- Capture errors from more `Createxxx` operations
- Address crashes on macOS in #27402

Improved ErrorScope model attempts to-

1. Identify and report `OutOfMemoryError` separately.
1. Match `GPUErrorFilter` and pass on uncaptured errors to parent scope.

r?@kvark

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-07-30 14:26:05 -04:00 committed by GitHub
commit f0ba895c68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 259 additions and 149 deletions

79
Cargo.lock generated
View file

@ -770,6 +770,21 @@ dependencies = [
"objc",
]
[[package]]
name = "cocoa-foundation"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318"
dependencies = [
"bitflags",
"block",
"core-foundation 0.9.0",
"core-graphics-types",
"foreign-types",
"libc",
"objc",
]
[[package]]
name = "color_quant"
version = "1.0.1"
@ -920,6 +935,16 @@ dependencies = [
"libc",
]
[[package]]
name = "core-foundation"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b5ed8e7e76c45974e15e41bfa8d5b0483cd90191639e01d8f5f1e606299d3fb"
dependencies = [
"core-foundation-sys 0.8.0",
"libc",
]
[[package]]
name = "core-foundation-sys"
version = "0.6.2"
@ -932,6 +957,12 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
[[package]]
name = "core-foundation-sys"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a21fa21941700a3cd8fcb4091f361a6a712fac632f85d9f487cc892045d55c6"
[[package]]
name = "core-graphics"
version = "0.17.3"
@ -956,6 +987,18 @@ dependencies = [
"libc",
]
[[package]]
name = "core-graphics-types"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e92f5d519093a4178296707dbaa3880eae85a5ef5386675f361a1cf25376e93c"
dependencies = [
"bitflags",
"core-foundation 0.9.0",
"foreign-types",
"libc",
]
[[package]]
name = "core-text"
version = "13.3.2"
@ -1889,22 +1932,21 @@ dependencies = [
[[package]]
name = "gfx-backend-metal"
version = "0.5.4"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "412a1e0e53e9e325a7c2e0316f1a4e8a14cbe8d8bfb5f030bc3895692f8a8254"
checksum = "92804d20b194de6c84cb4bec14ec6a6dcae9c51f0a9186817fb412a590131ae6"
dependencies = [
"arrayvec 0.5.1",
"bitflags",
"block",
"cocoa 0.20.1",
"cocoa-foundation",
"copyless",
"core-graphics 0.19.0",
"foreign-types",
"gfx-auxil",
"gfx-hal",
"lazy_static",
"log",
"metal",
"metal 0.20.0",
"objc",
"parking_lot 0.10.2",
"range-alloc",
@ -1916,14 +1958,14 @@ dependencies = [
[[package]]
name = "gfx-backend-vulkan"
version = "0.5.9"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f2e8bb53e5bea0bfec7035462a75717cd04d733963a225c816339a671ef108b"
checksum = "aec9c919cfc236d2c36aaa38609c1906a92f2df99a3c7f53022b01936f98275a"
dependencies = [
"arrayvec 0.5.1",
"ash",
"byteorder",
"core-graphics 0.19.0",
"core-graphics-types",
"gfx-hal",
"lazy_static",
"log",
@ -3433,6 +3475,20 @@ dependencies = [
"objc",
]
[[package]]
name = "metal"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c4e8a431536529327e28c9ba6992f2cb0c15d4222f0602a16e6d7695ff3bccf"
dependencies = [
"bitflags",
"block",
"cocoa-foundation",
"foreign-types",
"log",
"objc",
]
[[package]]
name = "metrics"
version = "0.0.1"
@ -5776,7 +5832,7 @@ dependencies = [
"libc",
"log",
"mach",
"metal",
"metal 0.18.0",
"objc",
"parking_lot 0.10.2",
"wayland-sys 0.24.0",
@ -6855,7 +6911,7 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.5.0"
source = "git+https://github.com/gfx-rs/wgpu#8a2ee26fffcdf02fc5e7f0a29771f4720522f7d8"
source = "git+https://github.com/gfx-rs/wgpu#9e4839eb049707629fa8a91e3603085433f352a4"
dependencies = [
"arrayvec 0.5.1",
"bitflags",
@ -6869,7 +6925,6 @@ dependencies = [
"gfx-descriptor",
"gfx-hal",
"gfx-memory",
"log",
"naga",
"parking_lot 0.10.2",
"ron",
@ -6883,7 +6938,7 @@ dependencies = [
[[package]]
name = "wgpu-types"
version = "0.5.0"
source = "git+https://github.com/gfx-rs/wgpu#8a2ee26fffcdf02fc5e7f0a29771f4720522f7d8"
source = "git+https://github.com/gfx-rs/wgpu#9e4839eb049707629fa8a91e3603085433f352a4"
dependencies = [
"bitflags",
"serde",