Skip to content

Commit

Permalink
Bug 1758156 - Check that the webgpu pref is enabled when creating PWe…
Browse files Browse the repository at this point in the history
…bGPUParent. r=aosmond

A better solution would check against the same value as reported by gfxConfig, which takes the pref as well as whether webgpu was blocked (for example due to buggy drivers) into account, but this still is good sanity check and easy to uplift.

Differential Revision: https://phabricator.services.mozilla.com/D140535
  • Loading branch information
nical committed Mar 9, 2022
1 parent 8986db3 commit b52fa79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gfx/ipc/CanvasManagerParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ already_AddRefed<dom::PWebGLParent> CanvasManagerParent::AllocPWebGLParent() {

already_AddRefed<webgpu::PWebGPUParent>
CanvasManagerParent::AllocPWebGPUParent() {
if (!StaticPrefs::dom_webgpu_enabled()) {
return nullptr;
}

return MakeAndAddRef<webgpu::WebGPUParent>();
}

Expand Down

0 comments on commit b52fa79

Please sign in to comment.