Commit 5d4b861
authored
d3d12: Include device removal reason when
Our "painful" `Error::Internal(String)` design for useful errors makes
it impossible for downstream crates to retrieve the original `HRESULT`
and match on it as necessary to action on stringified error codes like
`DXGI_ERROR_DEVICE_REMOVED`, which print:
ID3D12Device::CreatePlacedResource failed: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action. (0x887A0005)
Without rearchitecting our `Error` type, the nicest middle ground
is anyway for `gpu-allocator` to already add the error message from
`GetDeviceRemovedReason()` to the `Result` so that downstream crates
can immediately see in their error messages _why_ the device is or was
removed/suspended when they make an allocation.ERROR_DEVICE_REMOVED is raised (#262)1 parent 33fa052 commit 5d4b861
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
954 | 957 | | |
955 | 958 | | |
956 | 959 | | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
957 | 966 | | |
958 | 967 | | |
959 | 968 | | |
| |||
1064 | 1073 | | |
1065 | 1074 | | |
1066 | 1075 | | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
1067 | 1082 | | |
1068 | 1083 | | |
1069 | 1084 | | |
| |||
0 commit comments