Device resets or other forms of removal can cause a variety of crashes

RESOLVED FIXED in mozilla37

Status

()

Core
Graphics: Layers
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: bas, Assigned: bas)

Tracking

(Depends on: 1 bug)

unspecified
mozilla37
x86_64
Windows 8.1
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
Created attachment 8532262 [details] [diff] [review]
Deal properly with a D3D11 device reset

Currently when our D3D11 device is reinitialized because of hardware updates or removal, we crash. We shouldn't.
Attachment #8532262 - Flags: review?(nical.bugzilla)
Comment on attachment 8532262 [details] [diff] [review]
Deal properly with a D3D11 device reset

Review of attachment 8532262 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/d3d11/CompositorD3D11.cpp
@@ +952,5 @@
>                                     0);
>      HandleError(hr);
>    }
> +
> +  if (FAILED(hr)) {

please replace this FAILED(hr) by Failed(hr) and remove the two HandleError above.

Also you could just do

return Succeeded(hr);

::: gfx/thebes/gfxWindowsPlatform.cpp
@@ +385,5 @@
>   */
> +    if (DidRenderingDeviceReset()) {
> +      mD3D11DeviceInitialized = false;
> +      mD3D11Device = nullptr;
> +      mD3D11ContentDevice = nullptr;

Shouldn't you null out the dxgi adapter too? (I had to do it in my own version of the device reset patch.

Updated

3 years ago
Duplicate of this bug: 1086614

Updated

3 years ago
Attachment #8532262 - Flags: review?(nical.bugzilla) → review+
(Assignee)

Updated

3 years ago
Blocks: 1068320
(Assignee)

Comment 3

3 years ago
Created attachment 8539894 [details] [diff] [review]
Deal properly with a D3D11 device reset v2

This seems to work properly now for all reset scenarios I've tried. I'm sure I've missed something though :-).
Attachment #8532262 - Attachment is obsolete: true
Attachment #8539894 - Flags: review?(nical.bugzilla)
Comment on attachment 8539894 [details] [diff] [review]
Deal properly with a D3D11 device reset v2

Review of attachment 8539894 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with the assertion below back in place.

::: gfx/layers/d3d11/CompositorD3D11.cpp
@@ +1221,5 @@
>      return;
>    }
>    // XXX - It would be nice to use gfxCriticalError, but it needs to
>    // be made to work off the main thread first.
> +  //MOZ_ASSERT(aSeverity != DebugAssert);

Please uncomment this line.
Attachment #8539894 - Flags: review?(nical.bugzilla) → review+
https://hg.mozilla.org/mozilla-central/rev/6c673d6a2fb8
https://hg.mozilla.org/mozilla-central/rev/3ca05c4232ab
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Duplicate of this bug: 1118477
Depends on: 1120331
Duplicate of this bug: 1122035
You need to log in before you can comment on or make changes to this bug.